CMake: Don't force users to build specific library type#15526
Open
vishwamartur wants to merge 1 commit into
Open
CMake: Don't force users to build specific library type#15526vishwamartur wants to merge 1 commit into
vishwamartur wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #14520
Modify CMakeLists files to allow users to specify the type of library to build without hardcoding OBJECT, STATIC, or shared libs.
add_librarycalls inCMakeLists.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, andtargets/TARGET_STM/TARGET_STM32H7/CMakeLists.txtto use defaultadd_librarycalls with${CMAKE_LIBRARY_TYPE}.CMAKE_LIBRARY_TYPEvariable in their CMake configuration.