diff options
-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() |