diff options
author | Brad King <brad.king@kitware.com> | 2022-11-29 15:27:12 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-11-29 15:27:25 (GMT) |
commit | 3f05665a3fd29be65d3fe3176e7b6334322df321 (patch) | |
tree | 41920142a56561830e55825a27a1f6a5b7bd6d84 /Modules | |
parent | 0da7ec03dd4dea532e8549ed503e54f50bfbe0f2 (diff) | |
parent | f6b99c5087e1dfae29efc5146508e8b8b8b59b29 (diff) | |
download | CMake-3f05665a3fd29be65d3fe3176e7b6334322df321.zip CMake-3f05665a3fd29be65d3fe3176e7b6334322df321.tar.gz CMake-3f05665a3fd29be65d3fe3176e7b6334322df321.tar.bz2 |
Merge topic 'source-from-var' into release-3.25
f6b99c5087 Check*: Restore support for arbitrary result variable names
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7960
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CheckIncludeFiles.cmake | 5 | ||||
-rw-r--r-- | Modules/CheckTypeSize.cmake | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake index 8e82859..8fc6921 100644 --- a/Modules/CheckIncludeFiles.cmake +++ b/Modules/CheckIncludeFiles.cmake @@ -70,10 +70,11 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) message(FATAL_ERROR "Unknown arguments:\n ${ARGN}\n") endif() + string(MAKE_C_IDENTIFIER ${VARIABLE} _variable_escaped) if(_lang STREQUAL "C") - set(src ${VARIABLE}.c) + set(src ${_variable_escaped}.c) elseif(_lang STREQUAL "CXX") - set(src ${VARIABLE}.cpp) + set(src ${_variable_escaped}.cpp) else() message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n") endif() diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index b14ab06..e09b7c8 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -103,10 +103,11 @@ function(__check_type_size_impl type var map builtin language) endif() # Perform language check + string(MAKE_C_IDENTIFIER ${var} _var_escaped) if(language STREQUAL "C") - set(src ${var}.c) + set(src ${_var_escaped}.c) elseif(language STREQUAL "CXX") - set(src ${var}.cpp) + set(src ${_var_escaped}.cpp) else() message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n") endif() |