Closed hjyamauchi closed 3 months ago
Hi @hjyamauchi,
Do you have some hardcoded MSVC flags in your code, such as /Zi
? If yes, remove it, please.
Hi @AJIOB,
Possible. The code I'm building is LLVM. I'm not very clear on what's going on but this line seems to add /Zi
. But as this seems to happen with CMAKE_BUILD_TYPE=RelWithDebInfo
, too, I am not sure why.
My interpretation of the above doc was that passing -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded -DCMAKE_POLICY_CMP0141=NEW
is equivalent to adding the above cmake code that replaces /Zi
with /Z7
, but perhaps that's my misunderstanding?
Hi @hjyamauchi,
Yes, you're not fully correct.
CMake itself generates some flags for compiler & linker. CMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
and CMAKE_POLICY_CMP0141=NEW
arguments configures that.
But you still may add this flag manually (or via toolchain configuration scripts). In this way, you need to use an old-style variant with just hard replacing.
@AJIOB Thanks for clarification! CC @compnerd
I'm trying to use sccache with cmake 3.29.3 on Windows and despite what the usage doc says, neither
or
seem to actually do the
/Zi
->/Z7
conversion and the build still fails for me.But adding
to the top-level
CMakeLists.txt
, it seems to work.Am I using it wrong?