summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-21 13:03:37 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-05-21 13:03:37 (GMT)
commita696974298aebdf5b618ce981a4a355a872d474e (patch)
treecbb469402e56e9cc6f7e34896a54687a644b7f31 /Modules
parentf3c308dd82dce64b0bbf862d65dc473d35116b32 (diff)
parent6784f0a6eb21a3b6a0969aa08482ba7e3b23fa20 (diff)
downloadCMake-a696974298aebdf5b618ce981a4a355a872d474e.zip
CMake-a696974298aebdf5b618ce981a4a355a872d474e.tar.gz
CMake-a696974298aebdf5b618ce981a4a355a872d474e.tar.bz2
Merge topic 'CheckTypeSyze-CMP0054'
6784f0a6 CheckTypeSize: Avoid if() auto-dereferene in quoted arguments (#15571)
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)