Merge topic 'CheckTypeSyze-CMP0054'

6784f0a6 CheckTypeSize: Avoid if() auto-dereferene in quoted arguments (#15571)
This commit is contained in:
Brad King 2015-05-21 09:03:37 -04:00 committed by CMake Topic Stage
commit a696974298
1 changed files with 5 additions and 4 deletions

View File

@ -83,6 +83,7 @@ include(CheckIncludeFileCXX)
cmake_policy(PUSH) cmake_policy(PUSH)
cmake_policy(VERSION 3.0) cmake_policy(VERSION 3.0)
cmake_policy(SET CMP0054 NEW)
get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) 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. # Perform the check.
if("${language}" STREQUAL "C") if(language STREQUAL "C")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.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) set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.cpp)
else() else()
message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n") 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) set(_builtin 0)
else() else()
set(_builtin 1) set(_builtin 1)
if("${_language}" STREQUAL "C") if(_language STREQUAL "C")
check_include_file(sys/types.h HAVE_SYS_TYPES_H) check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H) check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_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(sys/types.h HAVE_SYS_TYPES_H)
check_include_file_cxx(stdint.h HAVE_STDINT_H) check_include_file_cxx(stdint.h HAVE_STDINT_H)
check_include_file_cxx(stddef.h HAVE_STDDEF_H) check_include_file_cxx(stddef.h HAVE_STDDEF_H)