[PATCH] D61387: [CMake] Cache result of CXXFeatureCheck
Chris Bieneman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 1 10:51:29 PDT 2019
beanz updated this revision to Diff 197593.
beanz added a comment.
Updating based on review feedback.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61387/new/
https://reviews.llvm.org/D61387
Files:
llvm/utils/benchmark/cmake/CXXFeatureCheck.cmake
Index: llvm/utils/benchmark/cmake/CXXFeatureCheck.cmake
===================================================================
--- llvm/utils/benchmark/cmake/CXXFeatureCheck.cmake
+++ llvm/utils/benchmark/cmake/CXXFeatureCheck.cmake
@@ -22,8 +22,9 @@
string(TOUPPER ${FILE} VAR)
string(TOUPPER "HAVE_${VAR}" FEATURE)
if (DEFINED HAVE_${VAR})
- set(HAVE_${VAR} 1 PARENT_SCOPE)
- add_definitions(-DHAVE_${VAR})
+ if(HAVE_${VAR})
+ add_definitions(-DHAVE_${VAR})
+ endif()
return()
endif()
@@ -52,7 +53,7 @@
if(RUN_${FEATURE} EQUAL 0)
message("-- Performing Test ${FEATURE} -- success")
- set(HAVE_${VAR} 1 PARENT_SCOPE)
+ set(HAVE_${VAR} ON CACHE BOOL "CXX feature test")
add_definitions(-DHAVE_${VAR})
else()
if(NOT COMPILE_${FEATURE})
@@ -60,5 +61,6 @@
else()
message("-- Performing Test ${FEATURE} -- compiled but failed to run")
endif()
+ set(HAVE_${VAR} OFF CACHE BOOL "CXX feature test")
endif()
endfunction()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61387.197593.patch
Type: text/x-patch
Size: 1000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190501/4d37cf4d/attachment.bin>
More information about the llvm-commits
mailing list