diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineASMCompiler.cmake | 19 | ||||
-rw-r--r-- | Modules/CMakeFindPackageMode.cmake | 2 | ||||
-rw-r--r-- | Modules/FindICU.cmake | 4 | ||||
-rw-r--r-- | Modules/FindThreads.cmake | 2 |
4 files changed, 22 insertions, 5 deletions
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index e8b9db7..a1814b7 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -125,6 +125,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) include(CMakeDetermineCompilerId) set(userflags) CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT} "${userflags}") + set(_variant "") if("x${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "xIAR") # primary necessary to detect architecture, so the right archiver and linker can be picked # eg. "IAR Assembler V8.10.1.12857/W32 for ARM" or "IAR Assembler V4.11.1.4666 for Renesas RX" @@ -137,6 +138,19 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) if(_all_compileid_matches) list(GET _all_compileid_matches "-1" CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID) endif() + elseif("x${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "xClang") + # Test whether an MSVC-like command-line option works. + execute_process(COMMAND ${CMAKE_ASM${ASM_DIALECT}_COMPILER} -? + OUTPUT_VARIABLE _clang_output + ERROR_VARIABLE _clang_output + RESULT_VARIABLE _clang_result) + if(_clang_result EQUAL 0) + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_FRONTEND_VARIANT "MSVC") + set(CMAKE_ASM${ASM_DIALECT}_SIMULATE_ID MSVC) + else() + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_FRONTEND_VARIANT "GNU") + endif() + set(_variant " with ${CMAKE_ASM${ASM_DIALECT}_COMPILER_FRONTEND_VARIANT}-like command-line") endif() _cmake_find_compiler_sysroot(ASM${ASM_DIALECT}) @@ -144,6 +158,8 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) unset(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_OUTPUT) unset(_all_compileid_matches) unset(_compileid) + unset(_clang_result) + unset(_clang_output) endif() if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) @@ -157,9 +173,10 @@ if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) else() set(_archid "") endif() - message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}${_archid}${_version}") + message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}${_archid}${_version}${_variant}") unset(_archid) unset(_version) + unset(_variant) else() message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown") endif() diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake index 815dfc9..726e2a2 100644 --- a/Modules/CMakeFindPackageMode.cmake +++ b/Modules/CMakeFindPackageMode.cmake @@ -78,7 +78,7 @@ if(UNIX) # from the outside if(NOT CMAKE_SIZEOF_VOID_P) set(CMAKE_SIZEOF_VOID_P 4) - if(EXISTS /usr/lib64) + if(EXISTS ${CMAKE_SYSROOT}/usr/lib64) set(CMAKE_SIZEOF_VOID_P 8) else() # use the file utility to check whether itself is 64 bit: diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake index 2bb49ad..1bae825 100644 --- a/Modules/FindICU.cmake +++ b/Modules/FindICU.cmake @@ -172,7 +172,7 @@ function(_ICU_FIND) DOC "ICU ${program} executable" NO_PACKAGE_ROOT_PATH ) - mark_as_advanced(cache_var) + mark_as_advanced("${cache_var}") set("${program_var}" "${${cache_var}}" PARENT_SCOPE) endforeach() @@ -301,7 +301,7 @@ function(_ICU_FIND) HINTS ${icu_roots} PATH_SUFFIXES ${icu_data_suffixes} DOC "ICU ${data} data file") - mark_as_advanced(cache_var) + mark_as_advanced("${cache_var}") set("${data_var}" "${${cache_var}}" PARENT_SCOPE) endforeach() diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index c6a3451..e4d6cf3 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -106,7 +106,7 @@ endmacro() # Do NOT even think about using it outside of this file! macro(_check_pthreads_flag) if(NOT Threads_FOUND) - # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread + # If we did not find -lpthreads, -lpthread, or -lthread, look for -pthread if(NOT DEFINED THREADS_HAVE_PTHREAD_ARG) message(CHECK_START "Check if compiler accepts -pthread") if(CMAKE_C_COMPILER_LOADED) |