-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add transitive object library function
- Loading branch information
Showing
3 changed files
with
61 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
14 changes: 8 additions & 6 deletions
14
examples/blinky-multiboard/src/board/nucleo-l412/CMakeLists.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
generate_stm32cube(stm32l412 LL_DRIVERS gpio utils pwr rcc) | ||
|
||
# NOTE: object libraries must be used when creating a library that uses | ||
# STM32Cube due to the way the linker handles weak symbols when linking static | ||
# libraries | ||
add_library(board_stm32l412 OBJECT board.c) | ||
target_include_directories(board_stm32l412 PUBLIC ../common/include) | ||
target_link_libraries( | ||
board_stm32l412 | ||
PUBLIC stm32::stm32l412_cmsis stm32::stm32l412_ll_gpio | ||
stm32::stm32l412_ll_utils stm32::stm32l412_ll_pwr | ||
stm32::stm32l412_ll_rcc) | ||
# create interface library to allow transitive OBJECT library dependencies | ||
add_library(_board_stm32l412 INTERFACE) | ||
target_link_libraries( | ||
_board_stm32l412 INTERFACE board_stm32l412 $<TARGET_OBJECTS:board_stm32l412>) | ||
# create alias for namespacing | ||
add_library(board::stm32l412 ALIAS _board_stm32l412) | ||
|
||
add_library(board::stm32l412 ALIAS board_stm32l412) | ||
# NOTE: object libraries are not transitive. if linking this library to another | ||
# object library, use this instead: | ||
# add_transitive_object_library(board::stm32l412 board_stm32l412) |
14 changes: 8 additions & 6 deletions
14
examples/blinky-multiboard/src/board/nucleo-l476/CMakeLists.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
generate_stm32cube(stm32l476 LL_DRIVERS gpio utils pwr rcc) | ||
|
||
# NOTE: object libraries must be used when creating a library that uses | ||
# STM32Cube due to the way the linker handles weak symbols when linking static | ||
# libraries | ||
add_library(board_stm32l476 OBJECT board.c) | ||
target_include_directories(board_stm32l476 PUBLIC ../common/include) | ||
target_link_libraries( | ||
board_stm32l476 | ||
PUBLIC stm32::stm32l476_cmsis stm32::stm32l476_ll_gpio | ||
stm32::stm32l476_ll_utils stm32::stm32l476_ll_pwr | ||
stm32::stm32l476_ll_rcc) | ||
# create interface library to allow transitive OBJECT library dependencies | ||
add_library(_board_stm32l476 INTERFACE) | ||
target_link_libraries( | ||
_board_stm32l476 INTERFACE board_stm32l476 $<TARGET_OBJECTS:board_stm32l476>) | ||
# create alias for namespacing | ||
add_library(board::stm32l476 ALIAS _board_stm32l476) | ||
|
||
add_library(board::stm32l476 ALIAS board_stm32l476) | ||
# NOTE: object libraries are not transitive. if linking this library to another | ||
# object library, use this instead: | ||
# add_transitive_object_library(board::stm32l476 board_stm32l476) |