[cmake-commits] hoffman committed cmLocalGenerator.cxx 1.238 1.239

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 19 22:24:02 EDT 2007


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

Modified Files:
	cmLocalGenerator.cxx 
Log Message:
ENH: do not always add -arch flags


Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.238
retrieving revision 1.239
diff -u -d -r1.238 -r1.239
--- cmLocalGenerator.cxx	15 Oct 2007 11:08:10 -0000	1.238
+++ cmLocalGenerator.cxx	20 Oct 2007 02:24:00 -0000	1.239
@@ -1941,14 +1941,31 @@
       std::vector<std::string> archs;
       cmSystemTools::ExpandListArgument(std::string(osxArch),
                                         archs);
-      for( std::vector<std::string>::iterator i = archs.begin();
-           i != archs.end(); ++i)
+      bool addArchFlag = true;
+      if(archs.size() == 1)
         {
-        flags += " -arch ";
-        flags += *i;
+        const char* archOrig = 
+          this->Makefile->GetSafeDefinition("CMAKE_OSX_ARCHITECTURE_DEFAULT");
+        if(archs[0] == archOrig)
+          {
+          addArchFlag = false;
+          }
+        }
+      // if there is more than one arch add the -arch and
+      // -isysroot flags, or if there is one arch flag, but
+      // it is not the default -arch flag for the system, then
+      // add it.  Otherwize do not add -arch and -isysroot
+      if(addArchFlag)
+        {
+        for( std::vector<std::string>::iterator i = archs.begin();
+             i != archs.end(); ++i)
+          {
+          flags += " -arch ";
+          flags += *i;
+          }
+        flags += " -isysroot ";
+        flags += sysroot;
         }
-      flags += " -isysroot ";
-      flags += sysroot;
       }
     }
   this->AddConfigVariableFlags(flags, flagsVar.c_str(), config);



More information about the Cmake-commits mailing list