Add caching for cxx_feature_check (#573)

This commit is contained in:
Yangqing Jia 2018-04-23 12:57:03 -07:00 committed by Dominic Hamon
parent 64d4805dd7
commit 105ac14b2f
1 changed files with 20 additions and 18 deletions

View File

@ -27,6 +27,7 @@ function(cxx_feature_check FILE)
return()
endif()
if (NOT DEFINED COMPILE_${FEATURE})
message("-- Performing Test ${FEATURE}")
if(CMAKE_CROSSCOMPILING)
try_compile(COMPILE_${FEATURE}
@ -47,6 +48,7 @@ function(cxx_feature_check FILE)
CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS}
LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES})
endif()
endif()
if(RUN_${FEATURE} EQUAL 0)
message("-- Performing Test ${FEATURE} -- success")