From f4f5dba46bdbde0e95d736cca124025745bcd7b6 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 4 Oct 2019 04:50:53 -0400 Subject: [PATCH] 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. --- cmake/CXXFeatureCheck.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/CXXFeatureCheck.cmake b/cmake/CXXFeatureCheck.cmake index 99b56dd6..059d510d 100644 --- a/cmake/CXXFeatureCheck.cmake +++ b/cmake/CXXFeatureCheck.cmake @@ -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}")