summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorFraser Hutchison <fraser.hutchison@maidsafe.net>2014-11-19 09:21:27 (GMT)
committerBrad King <brad.king@kitware.com>2014-11-19 21:22:56 (GMT)
commit543c4304bb48149ed2f642f88070829a30266ec0 (patch)
treeb5ecd5114611535899ebcdd4dd15b438f7230128 /Modules/Compiler
parent54ff77dc621a91302abad0ab38d9bd26de8914b9 (diff)
downloadCMake-543c4304bb48149ed2f642f88070829a30266ec0.zip
CMake-543c4304bb48149ed2f642f88070829a30266ec0.tar.gz
CMake-543c4304bb48149ed2f642f88070829a30266ec0.tar.bz2
Avoid if() quoted auto-dereference when checking for "MSVC"
When testing CMAKE_<LANG>_COMPILER_ID values against "MSVC", do not allow the definition of the "MSVC" variable to be expanded.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/AppleClang-CXX.cmake2
-rw-r--r--Modules/Compiler/Clang-CXX.cmake2
-rw-r--r--Modules/Compiler/Clang.cmake4
3 files changed, 4 insertions, 4 deletions
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index 0372e18..c1acae6 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -1,6 +1,6 @@
include(Compiler/Clang)
__compiler_clang(CXX)
-if(NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 5dd7b4a..9ef1413 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -1,7 +1,7 @@
include(Compiler/Clang)
__compiler_clang(CXX)
-if(NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index eeba119..701089c 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -18,8 +18,8 @@ if(__COMPILER_CLANG)
endif()
set(__COMPILER_CLANG 1)
-if(CMAKE_C_SIMULATE_ID STREQUAL "MSVC"
- OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
+ OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
macro(__compiler_clang lang)
endmacro()
else()