mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-18 23:08:25 -05:00
Fix clang-cl dependency builds failing on a precompiled header from the compiler cache
This commit is contained in:
1 parent
f49d49b5a6
commit
7149728219
1 file changed
+8
@@ -1,10 +1,18 @@
|
|||||||
# ccache does not parse the -clang: arguments CMake uses for clang-cl's gcc-style
|
# ccache does not parse the -clang: arguments CMake uses for clang-cl's gcc-style
|
||||||
# depfile, so a cache hit writes the object and no depfile, and Ninja then records
|
# depfile, so a cache hit writes the object and no depfile, and Ninja then records
|
||||||
# no headers for that object. ccache reproduces /showIncludes output on a hit.
|
# no headers for that object. ccache reproduces /showIncludes output on a hit.
|
||||||
|
#
|
||||||
|
# Clang also records the modification time of every input in a precompiled header
|
||||||
|
# and rejects the header once one differs. ccache caches the compile that creates
|
||||||
|
# the header, so a tree that regenerates cmake_pch.cxx gets back a header stamped
|
||||||
|
# with the old file's time, and every compile that uses it fails. The build system
|
||||||
|
# already rebuilds the header when an input changes. This covers the dependencies,
|
||||||
|
# such as wxWidgets; PrecompiledHeader.cmake does the same for OrcaSlicer's targets.
|
||||||
foreach (_lang C CXX)
|
foreach (_lang C CXX)
|
||||||
if (CMAKE_${_lang}_COMPILER_ID STREQUAL "Clang" AND
|
if (CMAKE_${_lang}_COMPILER_ID STREQUAL "Clang" AND
|
||||||
CMAKE_${_lang}_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
CMAKE_${_lang}_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||||
set(CMAKE_DEPFILE_FLAGS_${_lang} "/showIncludes")
|
set(CMAKE_DEPFILE_FLAGS_${_lang} "/showIncludes")
|
||||||
set(CMAKE_${_lang}_DEPFILE_FORMAT msvc)
|
set(CMAKE_${_lang}_DEPFILE_FORMAT msvc)
|
||||||
|
list(APPEND CMAKE_${_lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -fno-pch-timestamp)
|
||||||
endif ()
|
endif ()
|
||||||
endforeach ()
|
endforeach ()
|
||||||
Reference in new issue
Block a user