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,099
    • Issues 4,099
    • 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
  • Issues
  • #22564
Closed
Open
Issue created Aug 23, 2021 by Magnus Grandin@magnus.grandin

Warning when importing shared library on cross-compiled platform that does not support shared libraries

We have a cross-compiled project, where we have a certain shared library which is built for host, and then imported in the cross-compiled project via add_library(... SHARED IMPORTED). The target platform does not support shared libraries, so we get a warning when configuring this project

CMake Warning (dev) at xyz/CMakeLists.txt:22 (add_library):
  ADD_LIBRARY called with SHARED option but the target platform does not
  support dynamic linking.  Building a STATIC library instead.  This may lead
  to problems.

In our view, this warning is not meaningful for imported libraries, since they are not modified by the project. In our case, we are not using the imported library for the target platform, but for the host platform, and we would like to get rid of this warning.

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