Skip to content

GitLab

  • Menu
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 3,813
    • Issues 3,813
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & 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
  • CMake
  • CMakeCMake
  • Issues
  • #16947
Closed
Open
Created Jun 07, 2017 by Philip Salvaggio@psalvaggio

Whole archive linking as a target property

I occasionally have to use the -Wl,--whole-archive flags on C++ libraries when using various tricks like self-registering factories at static initialization time. In CMake, when I or other people use the libraries, the only way I have found to do this is to manually put these flags into the target_link_libraries() command, which is platform dependent, as Mac OS X and MSVC both have alternatives for this flag.

Is there a way to apply these flags in a cross-platgorm manner using a target property? I was looking for something like INTERFACE_LINK_OPTIONS but I didn't see anything on the property list.

Thanks!

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking