summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorRussell Greene <russell@shotover.com>2023-02-03 15:32:31 (GMT)
committerBrad King <brad.king@kitware.com>2023-02-03 15:39:22 (GMT)
commit7201bc072c9fed3373522ab8457ec8bdc0627f2a (patch)
tree94cd2f55bbb50a0006bee8708b21d07790e08c02 /Modules/CMakeDetermineCompilerId.cmake
parent77610c6cf0fd18586eaaf4b328936f79683afd34 (diff)
downloadCMake-7201bc072c9fed3373522ab8457ec8bdc0627f2a.zip
CMake-7201bc072c9fed3373522ab8457ec8bdc0627f2a.tar.gz
CMake-7201bc072c9fed3373522ab8457ec8bdc0627f2a.tar.bz2
CompilerId: Fix handling of CMAKE_<LANG>_FLAGS with quotes
Use `separate_arguments` to correctly parse arguments with quotes. Fixes: #24385
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 41e0e1a..1f89c74 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -35,7 +35,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
else(CMAKE_${lang}_FLAGS_INIT)
set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS_INIT})
endif()
- string(REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
+ separate_arguments(CMAKE_${lang}_COMPILER_ID_FLAGS_LIST NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
# Compute the directory in which to run the test.
set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_PLATFORM_INFO_DIR}/CompilerId${lang})