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

pkgconfig/fmt.pc is overwritten between debug and release builds #2718

Closed
gh-andre opened this issue Jan 14, 2022 · 1 comment
Closed

pkgconfig/fmt.pc is overwritten between debug and release builds #2718

gh-andre opened this issue Jan 14, 2022 · 1 comment
Labels

Comments

@gh-andre
Copy link

When I install debug and release fmt libraries via CMake, the last one overwrites plgconfig configuration.

For example, I download fmt-8.1.0.zip and extract it into fmt-8.1.0 in the current directory and build it as follows:

FMT_VER=8.1.0

cmake -S fmt-${FMT_VER}
      -B fmt-${FMT_VER}/Release
      -DFMT_TEST=OFF
      -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE
      -DCMAKE_BUILD_TYPE=Release

cmake -S fmt-${FMT_VER}
      -B fmt-${FMT_VER}/Debug
      -DFMT_TEST=OFF
      -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE
      -DCMAKE_BUILD_TYPE=Debug

cmake --build fmt-${FMT_VER}/Release
cmake --build fmt-${FMT_VER}/Debug

cmake --install fmt-${FMT_VER}/Release
cmake --install fmt-${FMT_VER}/Debug

This generates a single /usr/local/lib64/pkgconfig/fmt.pc file, so when I run pkg-config --libs fmt, it returns -L/usr/local/lib64 -lfmtd.

This is not a problem on build machines because there's typically no debug libraries built or installed, but on developer machines it leads to linking problems.

From another issue (#1264 (comment)) I see that fmt.pc is intended for release builds, but that would make it more complicated to use it in make files that build both types.

I reworked my make files to use just fmt libraries appropriate for each build type, so this is more of an FYI.

@vitaut
Copy link
Contributor

vitaut commented Jan 14, 2022

You could probably control the install location via normal CMake methods and separate debug/release binaries and configs.

this is more of an FYI

Closing the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants