summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2015-05-16 20:40:46 (GMT)
committerBrad King <brad.king@kitware.com>2015-05-19 16:47:24 (GMT)
commit6784f0a6eb21a3b6a0969aa08482ba7e3b23fa20 (patch)
tree6f8fbbe6bedd776fafd24f464cb019de1f5fc6c5 /Modules
parentebf8a41984f591dbd6c22735aec7f2b1c36c9e0a (diff)
downloadCMake-6784f0a6eb21a3b6a0969aa08482ba7e3b23fa20.zip
CMake-6784f0a6eb21a3b6a0969aa08482ba7e3b23fa20.tar.gz
CMake-6784f0a6eb21a3b6a0969aa08482ba7e3b23fa20.tar.bz2
CheckTypeSize: Avoid if() auto-dereferene in quoted arguments (#15571)
Exposed by a CMP0054 warning. Set CMP0054 to NEW since no code in this module depends on the old behavior.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CheckTypeSize.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 73ad86e..8c7acb5 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -83,6 +83,7 @@ include(CheckIncludeFileCXX)
cmake_policy(PUSH)
cmake_policy(VERSION 3.0)
+cmake_policy(SET CMP0054 NEW)
get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
@@ -112,9 +113,9 @@ function(__check_type_size_impl type var map builtin language)
# Perform the check.
- if("${language}" STREQUAL "C")
+ if(language STREQUAL "C")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
- elseif("${language}" STREQUAL "CXX")
+ elseif(language STREQUAL "CXX")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.cpp)
else()
message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n")
@@ -229,11 +230,11 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE)
set(_builtin 0)
else()
set(_builtin 1)
- if("${_language}" STREQUAL "C")
+ if(_language STREQUAL "C")
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H)
- elseif("${_language}" STREQUAL "CXX")
+ elseif(_language STREQUAL "CXX")
check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H)
check_include_file_cxx(stdint.h HAVE_STDINT_H)
check_include_file_cxx(stddef.h HAVE_STDDEF_H)