summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-08 11:47:00 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-08 11:47:09 (GMT)
commitf39ea2e292079707feceeb256b242d8f41b71ee9 (patch)
tree6e21a7d7f47bf594214fea759393f885994c35ab /Modules/CMakeDetermineCompilerId.cmake
parent34f05129a37be61158a139a29bfbc23d353630fa (diff)
parent3953dfcb315f6d85966703f01c7fbb0ac262e928 (diff)
downloadCMake-f39ea2e292079707feceeb256b242d8f41b71ee9.zip
CMake-f39ea2e292079707feceeb256b242d8f41b71ee9.tar.gz
CMake-f39ea2e292079707feceeb256b242d8f41b71ee9.tar.bz2
Merge topic 'flags-with-backslash'
3953dfcb31 Restore support for backslashes in initial language-wide flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5995
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake11
1 files changed, 6 insertions, 5 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 017c51a..d7b7f26 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -1,9 +1,9 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-macro(__determine_compiler_id_test testflags_in userflags)
- separate_arguments(testflags UNIX_COMMAND "${testflags_in}")
- CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${testflags}" "${userflags}" "${src}")
+macro(__determine_compiler_id_test testflags_var userflags_var)
+ separate_arguments(testflags UNIX_COMMAND "${${testflags_var}}")
+ CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${testflags}" "${${userflags_var}}" "${src}")
CMAKE_DETERMINE_COMPILER_ID_MATCH_VENDOR("${lang}" "${COMPILER_${lang}_PRODUCED_OUTPUT}")
if(NOT CMAKE_${lang}_COMPILER_ID)
@@ -44,7 +44,8 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endif()
foreach(userflags "${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}" "")
- __determine_compiler_id_test("${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS_FIRST}" "${userflags}")
+ set(testflags "${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS_FIRST}")
+ __determine_compiler_id_test(testflags userflags)
if(CMAKE_${lang}_COMPILER_ID)
break()
endif()
@@ -55,7 +56,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# of helper flags. Stop when the compiler is identified.
foreach(userflags "${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}" "")
foreach(testflags ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS_FIRST} "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS})
- __determine_compiler_id_test("${testflags}" "${userflags}")
+ __determine_compiler_id_test(testflags userflags)
if(CMAKE_${lang}_COMPILER_ID)
break()
endif()