summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeniz Bahadir <dbahadir@exocad.com>2022-02-07 14:33:02 (GMT)
committerDeniz Bahadir <dbahadir@exocad.com>2022-02-08 23:38:09 (GMT)
commit641cb1093b9b67875f60ed4a51110262f2170b12 (patch)
treef96ad9b9337fca8aa3c9924e1d8da23c26764f25
parenta15cc7706da8f4a1833539be3f37fbc63ee20e36 (diff)
downloadCMake-641cb1093b9b67875f60ed4a51110262f2170b12.zip
CMake-641cb1093b9b67875f60ed4a51110262f2170b12.tar.gz
CMake-641cb1093b9b67875f60ed4a51110262f2170b12.tar.bz2
Windows/Clang: Support PDB when cross-compiling
-rw-r--r--Modules/Platform/Windows-Clang.cmake1
-rw-r--r--Tests/RunCMake/CMakeLists.txt3
2 files changed, 3 insertions, 1 deletions
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index c4d6fd8..e7e975d 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -101,6 +101,7 @@ macro(__windows_compiler_clang_gnu lang)
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG -Xclang -gcodeview ${__ADDED_FLAGS}")
endif()
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
+ set(CMAKE_${lang}_LINKER_SUPPORTS_PDB ON)
set(CMAKE_PCH_EXTENSION .pch)
set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 1d7e632..6087021 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -84,7 +84,8 @@ endif()
# Test MSVC for older host CMake versions, and test
# WIN32/CMAKE_C_COMPILER_ID to fix check on Intel for Windows.
-if(MSVC OR (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel"))
+if(MSVC OR (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel")
+ OR (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_SIMULATE_ID MATCHES "MSVC"))
set(LINKER_SUPPORTS_PDB 1)
else()
set(LINKER_SUPPORTS_PDB 0)