Cache RUN_${FEATURE} variable in CXXFeatureCheck.cmake (#886)

When cross-compiling, this variable was not set on the second run
of CMake, resulting in the next check failing even though it shouldn't
be run in the first place. Fix this by caching the variable.
This commit is contained in:
Kyle Edwards 2019-10-04 04:50:53 -04:00 committed by Dominic Hamon
parent b8bce0c7ed
commit f4f5dba46b
1 changed files with 2 additions and 2 deletions

View File

@ -37,9 +37,9 @@ function(cxx_feature_check FILE)
if(COMPILE_${FEATURE})
message(WARNING
"If you see build failures due to cross compilation, try setting HAVE_${VAR} to 0")
set(RUN_${FEATURE} 0)
set(RUN_${FEATURE} 0 CACHE INTERNAL "")
else()
set(RUN_${FEATURE} 1)
set(RUN_${FEATURE} 1 CACHE INTERNAL "")
endif()
else()
message(STATUS "Performing Test ${FEATURE}")