Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug library suffix missing #636

Closed
ixSci opened this issue Jan 9, 2018 · 4 comments
Closed

Debug library suffix missing #636

ixSci opened this issue Jan 9, 2018 · 4 comments

Comments

@ixSci
Copy link

ixSci commented Jan 9, 2018

Just tried to use the fmt library and stumbled upon either inconsistency or my misunderstanding. I've downloaded the latest library archive, unzipped it and generated an MSVC solution out of it. So far so good. Then I've built the solution both for Debug and Release configuration and then installed both of them to the previously set install prefix. The thing is both Debug and Release library have the same name: fmt.lib and whichever configuration gets installed last will be at the target dir.

I've skimmed over the cmake files the library provides and it looks like (according to fmt-targets-debug.cmake) it actually rightfully expects to have fmtd.lib for the Debug configuration. I locally fixed the issue by adding set(CMAKE_DEBUG_POSTFIX "d") to the fmt CMake script.

Am I doing something wrong or the library build script does not actually generate a separate name for the Debug build?

@vitaut
Copy link
Contributor

vitaut commented Jan 13, 2018

Good catch, it's definitely a bug that the debug version of the library doesn't have a distinct suffix when installed. Could you submit a PR?

vitaut added a commit that referenced this issue Jan 20, 2018
@vitaut
Copy link
Contributor

vitaut commented Jan 20, 2018

Fixed in c157100. Thanks for reporting!

@vitaut vitaut closed this as completed Jan 20, 2018
vitaut added a commit that referenced this issue Feb 10, 2018
@ytimenkov
Copy link

Unfortunately this messes up things :( on non-MSVC platforms: the resulting library is libfmtd.a, but (for example) fmt.pc still has -lfmt.

Having set_target_properties in cmake script makes it impossible for packager to change the behavior.

I would rather leave this option to one who creates the package: ones who need fmtd can always add -DCMAKE_DEBUG_POSTFIX to the cmake invocation (or at least provide an overridable default).

I myself making a Conan package for fmt and would rather have a well-defined name even if I have to use VS.

@vitaut
Copy link
Contributor

vitaut commented Jun 19, 2019

the resulting library is libfmtd.a, but (for example) fmt.pc still has -lfmt.

I suggest fixing fmt.pc although there is little reason to distribute debug binaries.

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

No branches or pull requests

3 participants