From b9ab2b1932b08fb98308de6b271fcbca3ce313e2 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Fri, 2 Mar 2007 11:33:37 -0500 Subject: BUG: Propagate platform settings such as CMAKE_OSX_ARCHITECTURES to the try compile --- Modules/Platform/Darwin.cmake | 5 +++++ Source/cmTryCompileCommand.cxx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 035e37c..da11540 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -97,3 +97,8 @@ SET(CMAKE_SYSTEM_APPBUNDLE_PATH INCLUDE(Platform/UnixPaths) SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /sw/include) SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /sw/lib) + +IF(CMAKE_OSX_ARCHITECTURES) + SET(CMAKE_TRY_COMPILE_PLATFORM_OPTIONS "${CMAKE_TRY_COMPILE_PLATFORM_OPTIONS} + SET(CMAKE_OSX_ARCHITECTURES \"${CMAKE_OSX_ARCHITECTURES}\")") +ENDIF(CMAKE_OSX_ARCHITECTURES) diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index d299162..9109ae0 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -204,6 +204,11 @@ int cmTryCompileCommand::CoreTryCompileCode( } fprintf(fout, ")\n"); } + const char* platformOptions = mf->GetDefinition("CMAKE_TRY_COMPILE_PLATFORM_OPTIONS"); + if ( platformOptions ) + { + fprintf(fout, "%s\n", platformOptions); + } fprintf(fout, "ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",source.c_str()); fprintf(fout, -- cgit v0.12