Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 2,684
    • Issues 2,684
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 21
    • Merge Requests 21
  • Packages
    • Packages
    • Container Registry
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • CMake
  • CMakeCMake
  • Issues
  • #20061

Closed
Open
Opened Dec 02, 2019 by Timofey@timofey-retailnext
  • Report abuse
  • New issue
Report abuse New issue

broken protobuf*.pc file with cmake 3.16.0

I'm building google Protobuf 3.6.1 from sources on various x86_64-linux VMs. WEhen I use CMake 3.6.x, 3.12.x,3.14.x, 3.15.x, its generate correct ROOT/lib64/pkg-config/protobuf.pc file:

prefix=/opt/host-providence-tools exec_prefix=/opt/host-providence-tools libdir=/opt/host-providence-tools/lib64 includedir=/opt/host-providence-tools/include

Name: Protocol Buffers Description: Google's Data Interchange Format Version: 3.6.1 Libs: -L${libdir} -lprotobuf -lpthread Cflags: -I${includedir} -lpthread Conflicts: protobuf-lite

When I'm building same Protobuf version on same VM with latest 3.16.0, I get broken protobuf.pc file (see "pthread"):

prefix=/opt/host-providence-tools exec_prefix=/opt/host-providence-tools libdir=/opt/host-providence-tools/lib64 includedir=/opt/host-providence-tools/include

Name: Protocol Buffers Description: Google's Data Interchange Format Version: 3.6.1 Libs: -L${libdir} -lprotobuf pthread Cflags: -I${includedir} pthread Conflicts: protobuf-lite

Difference "-lpthread" -> "pthread" breaks building dependent packages, in my case it is google GRPC 1.16.1. I guess there is a bug or incompatible change in cmake "threads" package detection ... To my understanding, "-pthread" should be added to both compile and link flags. Alternatively, "-lpthread" maybe added to link flags.

Edited Dec 02, 2019 by Timofey
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: cmake/cmake#20061