PCH: REUSE_FROM use different PDB_PREFIX when copying pdb and compiling
Tested with CMake 3.16 on Windows with the Ninja generator and MSVC 2019 toolset.
When reusing a PCH from target target_with_pch
with the REUSE_FROM
signature the associated debug database .pdb
is first copied with:
cmake.exe -DPDB_PREFIX= copy_idb_pdb.cmake
Then, when compiling, the pdb file is prefixed lib
:
lima /Fdlibtarget_with_pch.pdb
which obviously fails with "ERROR 2859 libtarget_with_pch.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header.
AFAIU, the issue is with the discrepancy of the PDB_PREFIX
at copy and compile time.
Might be related to #19731 (closed)