Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4,098
    • Issues 4,098
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Merge requests
  • !6906

FindThreads: Honor THREADS_PREFER_PTHREAD_FLAG when pthread is found in libc

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Brad King requested to merge brad.king/cmake:FindThreads-libc-pthread-flag into master Jan 26, 2022
  • Overview 5
  • Commits 1
  • Pipelines 1
  • Changes 1

The -pthread flag tells the compiler/linker to link to additional libraries needed for thread support (e.g. libatomic on riscv64). The flag therefore should be used if requested using THREADS_PREFER_PTHREAD_FLAG also when the pthread functions are found in libc.

This backports !6693 (merged) to to CMake 3.21 and 3.22 branches.

Backport: release

Edited Jan 26, 2022 by Brad King
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: FindThreads-libc-pthread-flag