Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CMake: Don't force users to build specific library type #14520

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

Open
rwalton-arm opened this issue Apr 8, 2021 · 2 comments
Open

CMake: Don't force users to build specific library type #14520

rwalton-arm opened this issue Apr 8, 2021 · 2 comments

Comments

@rwalton-arm
Copy link
Contributor

Description of defect

Ideally we wouldn't hardcode OBJECT, STATIC or shared libs. We should use default add_library calls where possible and let the consumer specify which type of lib to build.

There are a few blockers to implementing this:

  • Mbed OS's use of weak linking
  • Cyclic dependencies in Mbed OS modules

Target(s) affected by this defect ?

All

Toolchain(s) (name and version) displaying this defect ?

All

What version of Mbed-os are you using (tag or sha) ?

master

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

All

How is this defect reproduced ?

Build mbed-os

@ciarmcom
Copy link
Member

ciarmcom commented Apr 8, 2021

Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers.
Internal Jira reference: https://jira.arm.com/browse/IOTOSM-3779

@40Grit
Copy link

40Grit commented May 13, 2021

I still await a package management solution

vishwamartur added a commit to vishwamartur/mbed-os that referenced this issue Oct 31, 2024
Related to ARMmbed#14520

Modify CMakeLists files to allow users to specify the type of library to build without hardcoding OBJECT, STATIC, or shared libs.

* Change `add_library` calls in `CMakeLists.txt`, `cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_A/CMakeLists.txt`, `cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_M/CMakeLists.txt`, `connectivity/CMakeLists.txt`, `targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/CMakeLists.txt`, `targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG11/CMakeLists.txt`, `targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFR32MG12/CMakeLists.txt`, `targets/TARGET_Silicon_Labs/TARGET_SL_RAIL/CMakeLists.txt`, `targets/TARGET_STM/CMakeLists.txt`, `targets/TARGET_STM/TARGET_STM32F0/CMakeLists.txt`, `targets/TARGET_STM/TARGET_STM32F1/CMakeLists.txt`, `targets/TARGET_STM/TARGET_STM32F2/CMakeLists.txt`, `targets/TARGET_STM/TARGET_STM32F3/CMakeLists.txt`, `targets/TARGET_STM/TARGET_STM32F4/CMakeLists.txt`, `targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xE/CMakeLists.txt`, `targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xG/CMakeLists.txt`, `targets/TARGET_STM/TARGET_STM32F7/CMakeLists.txt`, `targets/TARGET_STM/TARGET_STM32G0/CMakeLists.txt`, `targets/TARGET_STM/TARGET_STM32G4/CMakeLists.txt`, and `targets/TARGET_STM/TARGET_STM32H7/CMakeLists.txt` to use default `add_library` calls with `${CMAKE_LIBRARY_TYPE}`.
* Allow users to specify the type of library to build by setting the `CMAKE_LIBRARY_TYPE` variable in their CMake configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants