[cmake-commits] alex committed cmListFileCache.h 1.17 1.17.4.1 cmTryRunCommand.cxx 1.22 1.22.2.1 cmUtilitySourceCommand.cxx 1.22 1.22.2.1

cmake-commits at cmake.org cmake-commits at cmake.org
Fri May 11 14:03:52 EDT 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv2495/Source

Modified Files:
      Tag: CMake-CrossCompileBasic
	cmListFileCache.h cmTryRunCommand.cxx 
	cmUtilitySourceCommand.cxx 
Log Message:

BUG: same as HEAD: use a std::string instead a const char* for storing the filename

ENH: use CMAKE_EXECUTABLE_SUFFIX() in try_run and utility_source, although
usually they won't be able to run the executables (but IMO they shouldn't
complain they can't find the executables)

ENH: try_run now fails with "cant run executables if used with this
toolchain" if used with a user defined toolchain which didn't reset the CMAKE_ALIEN_EXECUTABLES flag

Alex


Index: cmUtilitySourceCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmUtilitySourceCommand.cxx,v
retrieving revision 1.22
retrieving revision 1.22.2.1
diff -u -d -r1.22 -r1.22.2.1
--- cmUtilitySourceCommand.cxx	12 May 2006 18:12:13 -0000	1.22
+++ cmUtilitySourceCommand.cxx	11 May 2007 18:03:50 -0000	1.22.2.1
@@ -88,7 +88,7 @@
   // Construct the cache entry for the executable's location.
   std::string utilityExecutable =
     utilityDirectory+"/"+cmakeCFGout+"/"
-    +utilityName+cmSystemTools::GetExecutableExtension();
+    +utilityName+this->Makefile->GetDefinition("CMAKE_EXECUTABLE_SUFFIX");
 
   // make sure we remove any /./ in the name
   cmSystemTools::ReplaceString(utilityExecutable, "/./", "/");

Index: cmListFileCache.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListFileCache.h,v
retrieving revision 1.17
retrieving revision 1.17.4.1
diff -u -d -r1.17 -r1.17.4.1
--- cmListFileCache.h	15 Mar 2006 16:02:04 -0000	1.17
+++ cmListFileCache.h	11 May 2007 18:03:50 -0000	1.17.4.1
@@ -52,7 +52,7 @@
 {
   std::string Name;
   std::vector<cmListFileArgument> Arguments;
-  const char* FilePath;
+  std::string FilePath;
   long Line;
 };
 

Index: cmTryRunCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTryRunCommand.cxx,v
retrieving revision 1.22
retrieving revision 1.22.2.1
diff -u -d -r1.22 -r1.22.2.1
--- cmTryRunCommand.cxx	14 Jun 2006 16:28:30 -0000	1.22
+++ cmTryRunCommand.cxx	11 May 2007 18:03:50 -0000	1.22.2.1
@@ -18,13 +18,20 @@
 #include "cmCacheManager.h"
 #include "cmTryCompileCommand.h"
 
-// cmExecutableCommand
+// cmTryRunCommand
 bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv)
 {
   if(argv.size() < 4)
     {
     return false;
     }
+    
+  if (this->Makefile->IsOn("CMAKE_ALIEN_EXECUTABLES"))
+    {
+    this->SetError("doesn't work when used with this toolchain.");
+    cmSystemTools::SetFatalErrorOccured();
+    return false;
+    }
 
   // build an arg list for TryCompile and extract the runArgs
   std::vector<std::string> tryCompile;
@@ -75,9 +82,10 @@
     {
     int retVal = -1;
     std::string output;
+    std::string executableSuffix=this->Makefile->GetDefinition("CMAKE_EXECUTABLE_SUFFIX");
     std::string command1 = binaryDirectory;
     command1 += "/cmTryCompileExec";
-    command1 += cmSystemTools::GetExecutableExtension();
+    command1 += executableSuffix;
     std::string fullPath;
     if(cmSystemTools::FileExists(command1.c_str()))
       {
@@ -87,7 +95,7 @@
       {
       std::string command2 = binaryDirectory;
       command2 += "/Debug/cmTryCompileExec";
-      command2 += cmSystemTools::GetExecutableExtension();
+      command2 += executableSuffix;
       if(cmSystemTools::FileExists(command2.c_str()))
         {
         fullPath = cmSystemTools::CollapseFullPath(command2.c_str());
@@ -96,7 +104,7 @@
         {
         std::string command3 = binaryDirectory;
         command3 += "/Development/cmTryCompileExec";
-        command3 += cmSystemTools::GetExecutableExtension();
+        command3 += executableSuffix;
         if(cmSystemTools::FileExists(command3.c_str()))
           {
           fullPath = cmSystemTools::CollapseFullPath(command3.c_str());



More information about the Cmake-commits mailing list