summaryrefslogtreecommitdiffstats
path: root/Modules/CheckIPOSupported.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-26 16:57:07 (GMT)
committerBrad King <brad.king@kitware.com>2020-03-26 16:57:07 (GMT)
commit4b8297721f3c7786c1a989b41a78ead231091704 (patch)
treed959031871bac14a6349067cf11606d2b3ba8b74 /Modules/CheckIPOSupported.cmake
parente3185e3d1b92a95c18f22f70b3cef6944dd019eb (diff)
downloadCMake-4b8297721f3c7786c1a989b41a78ead231091704.zip
CMake-4b8297721f3c7786c1a989b41a78ead231091704.tar.gz
CMake-4b8297721f3c7786c1a989b41a78ead231091704.tar.bz2
CheckIPOSupported: Avoid polluting cache with common name 'result'
Fixes: #20508
Diffstat (limited to 'Modules/CheckIPOSupported.cmake')
-rw-r--r--Modules/CheckIPOSupported.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake
index 0d6ad20..90a9f61 100644
--- a/Modules/CheckIPOSupported.cmake
+++ b/Modules/CheckIPOSupported.cmake
@@ -113,7 +113,7 @@ macro(_ipo_run_language_check language)
endforeach()
try_compile(
- result
+ _IPO_LANGUAGE_CHECK_RESULT
"${bindir}"
"${srcdir}"
"${TRY_COMPILE_PROJECT_NAME}"
@@ -122,8 +122,10 @@ macro(_ipo_run_language_check language)
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON"
OUTPUT_VARIABLE output
)
+ set(_IPO_LANGUAGE_CHECK_RESULT "${_IPO_LANGUAGE_CHECK_RESULT}")
+ unset(_IPO_LANGUAGE_CHECK_RESULT CACHE)
- if(NOT result)
+ if(NOT _IPO_LANGUAGE_CHECK_RESULT)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"${language} compiler IPO check failed with the following output:\n"
"${output}\n")