diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCompilerABI.cmake | 18 | ||||
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 4 |
2 files changed, 19 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index d6df305..81ec71c 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -24,10 +24,18 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src) # Compile the ABI identification source. SET(BIN "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDetermineCompilerABI_${lang}.bin") + SET(CMAKE_FLAGS ) + IF(DEFINED CMAKE_${lang}_VERBOSE_FLAG) + SET(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}") + ENDIF() TRY_COMPILE(CMAKE_DETERMINE_${lang}_ABI_COMPILED ${CMAKE_BINARY_DIR} ${src} - CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}" + CMAKE_FLAGS "${CMAKE_FLAGS}" "-DCMAKE_${lang}_STANDARD_LIBRARIES=" + # We need ignore these warnings because some platforms need + # CMAKE_${lang}_STANDARD_LIBRARIES to link properly and we + # don't care when we are just determining the ABI. + "--no-warn-unused-cli" OUTPUT_VARIABLE OUTPUT COPY_FILE "${BIN}" ) @@ -58,10 +66,16 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src) # Parse implicit linker information for this language, if available. SET(implicit_dirs "") SET(implicit_libs "") + SET(MULTI_ARCH FALSE) + IF(DEFINED CMAKE_OSX_ARCHITECTURES) + IF( "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" ) + SET(MULTI_ARCH TRUE) + ENDIF() + ENDIF() IF(CMAKE_${lang}_VERBOSE_FLAG # Implicit link information cannot be used explicitly for # multiple OS X architectures, so we skip it. - AND NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" + AND NOT MULTI_ARCH # Skip this with Xcode for now. AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode) CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index bf78a5b..9a3884a 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -243,7 +243,9 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) # ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface") ENDIF(NOT CMAKE_EXECUTABLE_FORMAT) - + IF(NOT DEFINED CMAKE_EXECUTABLE_FORMAT) + SET(CMAKE_EXECUTABLE_FORMAT) + ENDIF() # Return the information extracted. SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE) SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE) |