Browse Source

Ninja: dep files and multiple -arch flags not possible on mac

Peter Kuemmel 13 years ago
parent
commit
801f23fe51
1 changed files with 8 additions and 1 deletions
  1. 8 1
      Tests/BuildDepends/Project/CMakeLists.txt

+ 8 - 1
Tests/BuildDepends/Project/CMakeLists.txt

@@ -18,7 +18,14 @@ endfunction()
 if(APPLE)
   # only use multi-arch if the sysroot exists on this machine
   if(EXISTS "${CMAKE_OSX_SYSROOT}")
-    set(CMAKE_OSX_ARCHITECTURES "ppc;i386")
+    if("${CMAKE_GENERATOR}" MATCHES "Ninja")
+      # c++-4.2: -E, -S, -save-temps and -M options are not
+      #          allowed with multiple -arch flags
+      # but in a ninja build -MMD and -MT is set
+      set(CMAKE_OSX_ARCHITECTURES "i386")
+    else()
+      set(CMAKE_OSX_ARCHITECTURES "ppc;i386")
+    endif()
     test_for_xcode4(is_xcode4)
     if(is_xcode4)
       # Xcode 4, use modern architectures as defaults