diff options
| author | Chris Bieneman <beanz@apple.com> | 2016-05-11 20:37:43 +0000 |
|---|---|---|
| committer | Chris Bieneman <beanz@apple.com> | 2016-05-11 20:37:43 +0000 |
| commit | 1455de2171e8829f75935f11b254f404417c260c (patch) | |
| tree | 7f88f73dab32da94d38ae23b4ee92793facd3f74 | |
| parent | 1592d76d73ad3fb052511141d540a1170d32e985 (diff) | |
| download | bcm5719-llvm-1455de2171e8829f75935f11b254f404417c260c.tar.gz bcm5719-llvm-1455de2171e8829f75935f11b254f404417c260c.zip | |
[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
| -rw-r--r-- | compiler-rt/cmake/Modules/BuiltinTests.cmake | 16 | ||||
| -rw-r--r-- | compiler-rt/cmake/config-ix.cmake | 1 |
2 files changed, 9 insertions, 8 deletions
diff --git a/compiler-rt/cmake/Modules/BuiltinTests.cmake b/compiler-rt/cmake/Modules/BuiltinTests.cmake index fde5f759002..1b03e94acf1 100644 --- a/compiler-rt/cmake/Modules/BuiltinTests.cmake +++ b/compiler-rt/cmake/Modules/BuiltinTests.cmake @@ -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() diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake index 0025a0fc0e1..92c9f81a93e 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake @@ -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) |

