summaryrefslogtreecommitdiffstats
path: root/Modules/CheckStructHasMember.cmake
diff options
context:
space:
mode:
authorscivision <scivision@users.noreply.github.com>2023-03-10 03:08:45 (GMT)
committerscivision <scivision@users.noreply.github.com>2023-03-13 14:36:09 (GMT)
commit03c6ebf2b53956d9d8d035f9bf67bb73caca65f3 (patch)
tree339c721aef3fa301ecd50436522f4e239edc8c76 /Modules/CheckStructHasMember.cmake
parent7d43bcb4db2b26d9f9f8d828198252a44b5560a0 (diff)
downloadCMake-03c6ebf2b53956d9d8d035f9bf67bb73caca65f3.zip
CMake-03c6ebf2b53956d9d8d035f9bf67bb73caca65f3.tar.gz
CMake-03c6ebf2b53956d9d8d035f9bf67bb73caca65f3.tar.bz2
Modules:Check,GenerateExportHeader: include only what's needed
GenerateExportHeader had a hidden state requirement that other modules were included first. Considering include_guard, Modules should include all they actually use.
Diffstat (limited to 'Modules/CheckStructHasMember.cmake')
-rw-r--r--Modules/CheckStructHasMember.cmake7
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake
index 8217c84..33409e9 100644
--- a/Modules/CheckStructHasMember.cmake
+++ b/Modules/CheckStructHasMember.cmake
@@ -51,8 +51,7 @@ Example:
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckCSourceCompiles)
-include(CheckCXXSourceCompiles)
+include(CheckSourceCompiles)
macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
set(_INCLUDE_FILES)
@@ -78,9 +77,9 @@ int main()
")
if("${_lang}" STREQUAL "C")
- CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
+ CHECK_SOURCE_COMPILES(C "${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
elseif("${_lang}" STREQUAL "CXX")
- CHECK_CXX_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
+ CHECK_SOURCE_COMPILES(CXX "${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
else()
message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n")
endif()