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 · 1 comment · May be fixed by #19444
Open

PkgConfig of protobuf not compatible with CMAKE_BUILD_TYPE=Debug #19325

andresailer opened this issue Nov 20, 2024 · 1 comment · May be fixed by #19444

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
@acozzette acozzette added cmake bug and removed untriaged auto added to all issues by default when created. labels Nov 25, 2024
@acozzette
Copy link
Member

Thank you for the bug report. I don't think we have time to work on this right now but we would be happy to review a pull request if you would like to send us a fix. It seems like we need to fix the pkg-config output to account for this d suffix on debug builds. Or possibly we could consider dropping the special d suffix altogether.

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

Successfully merging a pull request may close this issue.

2 participants