summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeTests
diff options
context:
space:
mode:
authorMichael Maltese <michaeljosephmaltese@gmail.com>2017-01-24 02:58:18 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-06 18:12:06 (GMT)
commit72ed051b12d983d298b9447d3464a38f5e0f918c (patch)
treef9eeb4ee2a05d9c9785d674cfe259cf0fd46f21f /Tests/CMakeTests
parent0f4dae0a4da92af5079eb730443ec188b3b46f8e (diff)
downloadCMake-72ed051b12d983d298b9447d3464a38f5e0f918c.zip
CMake-72ed051b12d983d298b9447d3464a38f5e0f918c.tar.gz
CMake-72ed051b12d983d298b9447d3464a38f5e0f918c.tar.bz2
CMakeDetermineCompilerId: check with and without user-specified flags
Clang may raise an error when passed a `-march=` option that doesn't correspond to the current target triple. CMake cannot pass the target triple when determining the compiler id because it doesn't know how yet, but it does pass along user-specified flags. This breaks when those user-specified flags include `-march=`. Fix this use case by also trying to find the compiler id without the user-specified flags. Fixes: #16587
Diffstat (limited to 'Tests/CMakeTests')
-rw-r--r--Tests/CMakeTests/CompilerIdVendorTest.cmake.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tests/CMakeTests/CompilerIdVendorTest.cmake.in b/Tests/CMakeTests/CompilerIdVendorTest.cmake.in
index 68f6462..9cf5321 100644
--- a/Tests/CMakeTests/CompilerIdVendorTest.cmake.in
+++ b/Tests/CMakeTests/CompilerIdVendorTest.cmake.in
@@ -8,7 +8,6 @@ file(MAKE_DIRECTORY ${MY_BINARY_DIR})
set(CMAKE_MyLang_COMPILER ${CMAKE_COMMAND})
set(CMAKE_MyLang_COMPILER_ID_ARG1)
-set(CMAKE_MyLang_COMPILER_ID_FLAGS_LIST)
set(CMAKE_MyLang_COMPILER_ID_DIR ${MY_BINARY_DIR})
file(WRITE "${MY_BINARY_DIR}/BogusVendor.cmake" "message(\"This is a BogusVendor compiler\")")
@@ -22,7 +21,8 @@ set(CMAKE_MyLang_COMPILER_ID_VENDOR_FLAGS_MyVendor -P MyVendor.cmake)
set(CMAKE_MyLang_COMPILER_ID_VENDOR_REGEX_MyVendor MyVendor)
set(CMAKE_BINARY_DIR ${MY_BINARY_DIR})
-cmake_determine_compiler_id_vendor(MyLang)
+set(userflags)
+cmake_determine_compiler_id_vendor(MyLang "${userflags}")
if("${CMAKE_MyLang_COMPILER_ID}" STREQUAL "MyVendor")
message(STATUS "Found MyVendor compiler id!")