summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-19 16:50:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-07-19 16:50:58 (GMT)
commit8802d8f8e40cfa61733be7b36ec4b06d7e35575d (patch)
tree99b4cbd8f6768b4cbf7fa139e2800692f0605440 /Modules
parent2579e7c1f3c95040216c648260bfd17699c9df24 (diff)
parent3ddd7f35760055fc501d454f9029f3987536957b (diff)
downloadCMake-8802d8f8e40cfa61733be7b36ec4b06d7e35575d.zip
CMake-8802d8f8e40cfa61733be7b36ec4b06d7e35575d.tar.gz
CMake-8802d8f8e40cfa61733be7b36ec4b06d7e35575d.tar.bz2
Merge topic 'enable_language-CMP0126'
3ddd7f3576 enable_language: Fix test for working compiler with CMP0126 NEW behavior Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6355
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeTestCCompiler.cmake3
-rw-r--r--Modules/CMakeTestCSharpCompiler.cmake3
-rw-r--r--Modules/CMakeTestCUDACompiler.cmake4
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake3
-rw-r--r--Modules/CMakeTestFortranCompiler.cmake3
-rw-r--r--Modules/CMakeTestHIPCompiler.cmake3
-rw-r--r--Modules/CMakeTestOBJCCompiler.cmake3
-rw-r--r--Modules/CMakeTestOBJCXXCompiler.cmake3
-rw-r--r--Modules/CMakeTestSwiftCompiler.cmake3
9 files changed, 28 insertions, 0 deletions
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 03f2db2..ae5aa27 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -50,6 +50,9 @@ if(NOT CMAKE_C_COMPILER_WORKS)
"int main(int argc, char* argv[])\n"
"#endif\n"
"{ (void)argv; return argc-1;}\n")
+ # Clear result from normal variable.
+ unset(CMAKE_C_COMPILER_WORKS)
+ # Puts test result in cache variable.
try_compile(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestCSharpCompiler.cmake b/Modules/CMakeTestCSharpCompiler.cmake
index 1119a45..adea250 100644
--- a/Modules/CMakeTestCSharpCompiler.cmake
+++ b/Modules/CMakeTestCSharpCompiler.cmake
@@ -30,6 +30,9 @@ if(NOT CMAKE_CSharp_COMPILER_WORKS)
" }"
"}"
)
+ # Clear result from normal variable.
+ unset(CMAKE_CSharp_COMPILER_WORKS)
+ # Puts test result in cache variable.
try_compile(CMAKE_CSharp_COMPILER_WORKS ${CMAKE_BINARY_DIR} "${test_compile_file}"
OUTPUT_VARIABLE __CMAKE_CSharp_COMPILER_OUTPUT
)
diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake
index a18947b..25a3653 100644
--- a/Modules/CMakeTestCUDACompiler.cmake
+++ b/Modules/CMakeTestCUDACompiler.cmake
@@ -36,6 +36,10 @@ if(NOT CMAKE_CUDA_COMPILER_WORKS)
"#endif\n"
"int main(){return 0;}\n")
+ # Clear result from normal variable.
+ unset(CMAKE_CUDA_COMPILER_WORKS)
+
+ # Puts test result in cache variable.
try_compile(CMAKE_CUDA_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.cu
OUTPUT_VARIABLE __CMAKE_CUDA_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 0d2d0b0..bbe3533 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -43,6 +43,9 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
"# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
"#endif\n"
"int main(){return 0;}\n")
+ # Clear result from normal variable.
+ unset(CMAKE_CXX_COMPILER_WORKS)
+ # Puts test result in cache variable.
try_compile(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake
index 4fdec94..579f83f 100644
--- a/Modules/CMakeTestFortranCompiler.cmake
+++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -43,6 +43,9 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS)
PRINT *, 'Hello'
END
")
+ # Clear result from normal variable.
+ unset(CMAKE_Fortran_COMPILER_WORKS)
+ # Puts test result in cache variable.
try_compile(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
OUTPUT_VARIABLE OUTPUT)
diff --git a/Modules/CMakeTestHIPCompiler.cmake b/Modules/CMakeTestHIPCompiler.cmake
index d9fcc9d..62f0657 100644
--- a/Modules/CMakeTestHIPCompiler.cmake
+++ b/Modules/CMakeTestHIPCompiler.cmake
@@ -46,6 +46,9 @@ if(NOT CMAKE_HIP_COMPILER_WORKS)
"# error \"The CMAKE_HIP_COMPILER is set to a C/CXX compiler\"\n"
"#endif\n"
"int main(){return 0;}\n")
+ # Clear result from normal variable.
+ unset(CMAKE_HIP_COMPILER_WORKS)
+ # Puts test result in cache variable.
try_compile(CMAKE_HIP_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testHIPCompiler.hip
OUTPUT_VARIABLE __CMAKE_HIP_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestOBJCCompiler.cmake b/Modules/CMakeTestOBJCCompiler.cmake
index 298272b..20d1f8b 100644
--- a/Modules/CMakeTestOBJCCompiler.cmake
+++ b/Modules/CMakeTestOBJCCompiler.cmake
@@ -47,6 +47,9 @@ if(NOT CMAKE_OBJC_COMPILER_WORKS)
"#endif\n"
"int main(int argc, char* argv[])\n"
"{ (void)argv; return argc-1;}\n")
+ # Clear result from normal variable.
+ unset(CMAKE_OBJC_COMPILER_WORKS)
+ # Puts test result in cache variable.
try_compile(CMAKE_OBJC_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCCompiler.m
OUTPUT_VARIABLE __CMAKE_OBJC_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestOBJCXXCompiler.cmake b/Modules/CMakeTestOBJCXXCompiler.cmake
index 36e3efc..4f7185f 100644
--- a/Modules/CMakeTestOBJCXXCompiler.cmake
+++ b/Modules/CMakeTestOBJCXXCompiler.cmake
@@ -46,6 +46,9 @@ if(NOT CMAKE_OBJCXX_COMPILER_WORKS)
"# error \"The CMAKE_OBJCXX_COMPILER is not an Objective-C++ compiler\"\n"
"#endif\n"
"int main(){return 0;}\n")
+ # Clear result from normal variable.
+ unset(CMAKE_OBJCXX_COMPILER_WORKS)
+ # Puts test result in cache variable.
try_compile(CMAKE_OBJCXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCXXCompiler.mm
OUTPUT_VARIABLE __CMAKE_OBJCXX_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake
index d98dc9d..2f2546f 100644
--- a/Modules/CMakeTestSwiftCompiler.cmake
+++ b/Modules/CMakeTestSwiftCompiler.cmake
@@ -23,6 +23,9 @@ if(NOT CMAKE_Swift_COMPILER_WORKS)
PrintTestCompilerStatus("Swift")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
"print(\"CMake\")\n")
+ # Clear result from normal variable.
+ unset(CMAKE_Swift_COMPILER_WORKS)
+ # Puts test result in cache variable.
try_compile(CMAKE_Swift_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
OUTPUT_VARIABLE __CMAKE_Swift_COMPILER_OUTPUT)