CMake: Don't force users to build specific library type #15526
+119
−118
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_library
calls 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.txt
to use defaultadd_library
calls with${CMAKE_LIBRARY_TYPE}
.CMAKE_LIBRARY_TYPE
variable in their CMake configuration.