Skip to content

Conversation

@jedfrechette
Copy link

Closes #29

message("ClangCl does not support pdb generation with static libraries")
elseif(MSVC)
install(FILES ${PROJECT_BINARY_DIR}/raw.pdb ${PROJECT_BINARY_DIR}/raw_r.pdb
install(FILES ${PROJECT_BINARY_DIR}/raw${CMAKE_DEBUG_POSTFIX}.pdb ${PROJECT_BINARY_DIR}/raw_r${CMAKE_DEBUG_POSTFIX}.pdb
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break when building in release mode?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, for release builds CMAKE_DEBUG_POSTFIX will return an empty string so you'll get the same behavior as currently with the resulting installed files of raw.pdb and raw_r.pdb. At least that's what my testing shows.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CMake docs https://cmake.org/cmake/help/latest/variable/CMAKE_CONFIG_POSTFIX.html don't suggest that this is only set for matching build types. Which makes sense to me as having this information available in general is useful for multi-config generators.
@hartcw Any advice since you added pdb installation in 9e4991f?

@ribtoks
Copy link

ribtoks commented Sep 2, 2023

Anything that prevents from merging this PR? I'm hitting the same issue! Thanks @jedfrechette for fixing it!

UPD. There's also this issue that ./Debug/ folder is missing in the path before the raw.pdb - should probably add ${CMAKE_BUILD_TYPE}/

@letmaik
Copy link
Collaborator

letmaik commented Sep 2, 2023

@ribtoks It would be helpful if you could test this locally and submit a new PR given that the original author isn't responsive.

@ribtoks
Copy link

ribtoks commented Sep 2, 2023

#40 Literally just "tested locally" on Windows 10 and ended up using my temporary fork as this change is not in the main repository. Seems to work "on my computer" just fine. Visual Studio 2019, CMake 3.18.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[install] Install incorrect pdb name, missing suffix ${CMAKE_DEBUG_POSTFIX}

3 participants