summaryrefslogtreecommitdiff
path: root/Modules/CMakeTestOBJCCompiler.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeTestOBJCCompiler.cmake')
-rw-r--r--Modules/CMakeTestOBJCCompiler.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/CMakeTestOBJCCompiler.cmake b/Modules/CMakeTestOBJCCompiler.cmake
index 298272b85..20d1f8be9 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)