diff options
author | Brad King <brad.king@kitware.com> | 2014-03-20 13:22:23 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-03-20 13:22:23 (GMT) |
commit | 82c590b12ed7301539202b0af92f8181f7708f16 (patch) | |
tree | 8d2cccfc552460bb9006e669f3af875e7445a22d /Modules | |
parent | c79d98b457e9c2fc87ddf54631640e2efe8d81c4 (diff) | |
parent | 7f857775e212436dbca623a4bfe37a20c6c98e0a (diff) | |
download | CMake-82c590b12ed7301539202b0af92f8181f7708f16.zip CMake-82c590b12ed7301539202b0af92f8181f7708f16.tar.gz CMake-82c590b12ed7301539202b0af92f8181f7708f16.tar.bz2 |
Merge topic 'CheckTypeSize_#14056'
7f857775 CheckTypeSize: Add unit test to cover the no-C case
7d6d45f2 CheckTypeSize: Support for CXX when C language is not enabled
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CheckTypeSize.cmake | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index ec28d8b..333b325 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -75,6 +75,7 @@ # License text for the above reference.) include(CheckIncludeFile) +include(CheckIncludeFileCXX) cmake_policy(PUSH) cmake_minimum_required(VERSION 2.6 FATAL_ERROR) @@ -218,9 +219,15 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE) set(_builtin 0) else() set(_builtin 1) - 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) + 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") + 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) + endif() endif() unset(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY) unset(_CHECK_TYPE_SIZE_LANGUAGE) |