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 of protobuf not compatible with CMAKE_BUILD_TYPE=Debug #19325

Open
andresailer opened this issue Nov 20, 2024 · 0 comments
Open

PkgConfig of protobuf not compatible with CMAKE_BUILD_TYPE=Debug #19325

andresailer opened this issue Nov 20, 2024 · 0 comments
Labels
untriaged auto added to all issues by default when created.

Comments

@andresailer
Copy link

What version of protobuf and what language are you using?
Version: 5.25.4
Language: C++

What operating system (Linux, Windows, ...) and version?

Alma Linux 9

What runtime / compiler are you using (e.g., python version or gcc version)
gcc13

What did you do?
Steps to reproduce the behavior:
Configured protobuf with

-D CMAKE_BUILD_TYPE=Debug

And then try linking another project that uses pkgconfig to find protobuf

What did you expect to see

A successfully linked package

What did you see instead?

linker cannot find -lprotobuf

The problem

CMake defines a postfix for debug builds

protobuf/CMakeLists.txt

Lines 54 to 55 in 3ba0709

set(protobuf_DEBUG_POSTFIX "d"
CACHE STRING "Default debug postfix")

But the pkgconfig template does not account for this possible postfix

Libs: -L${libdir} -lprotobuf @CMAKE_THREAD_LIBS_INIT@

@andresailer andresailer added the untriaged auto added to all issues by default when created. label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged auto added to all issues by default when created.
Projects
None yet
Development

No branches or pull requests

1 participant