mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-02 21:22:44 +00:00
[CMake] Cache check results and avoid duplicate checks
This caches the result of builtin_check_c_compiler_flag, and removes a duplicate check for C99 flag support. llvm-svn: 269230
This commit is contained in:
parent
1592d76d73
commit
1455de2171
@ -49,12 +49,14 @@ function(try_compile_only output)
|
||||
endfunction()
|
||||
|
||||
function(builtin_check_c_compiler_flag flag output)
|
||||
message(STATUS "Performing Test ${output}")
|
||||
try_compile_only(result ${flag})
|
||||
set(${output} ${result} PARENT_SCOPE)
|
||||
if(${result})
|
||||
message(STATUS "Performing Test ${output} - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test ${output} - Failed")
|
||||
if(NOT DEFINED ${output})
|
||||
message(STATUS "Performing Test ${output}")
|
||||
try_compile_only(result ${flag})
|
||||
set(${output} ${result} CACHE INTERNAL "Compiler supports ${flag}")
|
||||
if(${result})
|
||||
message(STATUS "Performing Test ${output} - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test ${output} - Failed")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
@ -29,7 +29,6 @@ check_cxx_compiler_flag(-std=c++11 COMPILER_RT_HAS_STD_CXX11_FLAG)
|
||||
check_cxx_compiler_flag(-ftls-model=initial-exec COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC)
|
||||
check_cxx_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG)
|
||||
check_cxx_compiler_flag("-Werror -msse3" COMPILER_RT_HAS_MSSE3_FLAG)
|
||||
check_cxx_compiler_flag(-std=c99 COMPILER_RT_HAS_STD_C99_FLAG)
|
||||
check_cxx_compiler_flag(--sysroot=. COMPILER_RT_HAS_SYSROOT_FLAG)
|
||||
|
||||
if(NOT WIN32 AND NOT CYGWIN)
|
||||
|
Loading…
x
Reference in New Issue
Block a user