From 801f23fe517d305f5f38a38d534d2caec09d7ab8 Mon Sep 17 00:00:00 2001 From: Peter Kuemmel Date: Tue, 19 Jun 2012 21:19:29 +0200 Subject: Ninja: dep files and multiple -arch flags not possible on mac --- Tests/BuildDepends/Project/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index a977884..4a17c43 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/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 -- cgit v0.12 From 392a6541b51dac5080a32fde67bc8aefd92a7226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Tue, 10 Jul 2012 13:43:01 +0200 Subject: Ninja: on Mac no multiple -arch because of -M --- Tests/BuildDepends/Project/CMakeLists.txt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index 4a17c43..e97b661 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -17,15 +17,9 @@ endfunction() if(APPLE) # only use multi-arch if the sysroot exists on this machine - if(EXISTS "${CMAKE_OSX_SYSROOT}") - 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() + # Ninja needs -M which could not be used with multiple -arch flags + if(EXISTS "${CMAKE_OSX_SYSROOT}" AND NOT "${CMAKE_GENERATOR}" MATCHES "Ninja") + set(CMAKE_OSX_ARCHITECTURES "ppc;i386") test_for_xcode4(is_xcode4) if(is_xcode4) # Xcode 4, use modern architectures as defaults -- cgit v0.12 From 207ec5c3b13726bbb61d29bb1191ddbe992f8c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Wed, 18 Jul 2012 09:51:43 +0200 Subject: Ninja: fix mis-matching endif() argument --- Tests/BuildDepends/Project/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index e97b661..ed8b8bf 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -26,7 +26,7 @@ if(APPLE) # Arch 'ppc' no longer works: tools no longer available starting with Xcode 4 set(CMAKE_OSX_ARCHITECTURES i386 x86_64) endif() - endif(EXISTS "${CMAKE_OSX_SYSROOT}") + endif() endif(APPLE) add_library(foo STATIC ${testRebuild_BINARY_DIR}/foo.cxx) -- cgit v0.12