CMakeDetermineCompilerId: Fix REQUIRE_SUCCESS with multiple user flags

Need to quote the list expansion otherwise we'll try each argument separately.
This commit is contained in:
Raul Tambre
2021-03-02 16:19:14 +02:00
parent b212fba208
commit 1bd8f19453

View File

@@ -43,7 +43,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
set(__compiler_id_require_success TRUE)
endif()
foreach(userflags ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} "")
foreach(userflags "${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}" "")
__determine_compiler_id_test("${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS_FIRST}" "${userflags}")
if(CMAKE_${lang}_COMPILER_ID)
break()