MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0016071 | CMake | CMake | public | 2016-04-19 13:02 | 2016-06-10 14:21 |
Reporter | Itai Seggev | ||||
Assigned To | |||||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Platform | OS | OS Version | |||
Product Version | CMake 3.5.2 | ||||
Target Version | Fixed in Version | ||||
Summary | 0016071: CMake should map /Fd to COMPILE_PDB_NAME for static libraries | ||||
Description | This is a follow up to https://cmake.org/Bug/view.php?id=14763 [^] and its predecessors https://cmake.org/Bug/view.php?id=14060 [^] / https://cmake.org/Bug/view.php?id=14062 [^] /Fd was separated from PDB_NAME, because normally what we want is the linker pdb. However, if our final product is the static library, then we do want to the compiler PDB file, so COMPILE_PDB_NAME was added. Yet, a mapping was not added between COMPILE_PDB_NAME and /Fd. The result is /Fd is added to compile flags but COMPILE_PDB_NAME remains at its default value, and an inconsistency is created between Visual Studio and NMake generators. For the former, the flag is honored, but for the latter it is overridden by the NMake file's own specification of /Fd. Thus, for dlls and exes, you can simply add /PDB to the link flags, but for static libraries you must manually manipulate the COMPILE_PDB_NAME property for the target. I think that /Fd, certainly for static libraries which have no link step, should be mapped to COMPILE_PDB_NAME. | ||||
Steps To Reproduce | Create a minimal CMakeLists.txt like the following: project(foo) add_library(myLib STATIC myLib.c) target_compile_options(myLib PUBLIC $<$<PLATFORM_ID:Windows>:/Zi /FdmyLib.pdb>) Generate a NMake Makefiles build system and build. You will see cl : Command line warning D9025 : overriding '/FdmyLib.pdb' with '/FdCMakeFiles\myLib.dir/' and the PDB file is indeed CMakeFiles\myLib.dir\vc120.pdb. If you generate a Visual Studio project and build, there is no warning and the pdb file is .\myLib.pdb. And indeed the pdb file will be | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2016-04-19 13:02 | Itai Seggev | New Issue | |||
2016-04-19 13:19 | Brad King | Note Added: 0040892 | |||
2016-04-19 23:03 | Itai Seggev | Note Added: 0040896 | |||
2016-04-20 08:53 | Brad King | Note Added: 0040897 | |||
2016-04-20 08:53 | Brad King | Status | new => resolved | ||
2016-04-20 08:53 | Brad King | Resolution | open => won't fix | ||
2016-06-10 14:21 | Kitware Robot | Note Added: 0041189 | |||
2016-06-10 14:21 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|