Skip to content
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

fix: avoid using generator expressions for linking to targets #92

Merged
merged 3 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions hal_st/std_periph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,25 @@ add_subdirectory(atomic)
add_library(hal_st.std_periph ${HALST_EXCLUDE_FROM_ALL} INTERFACE)
install(TARGETS hal_st.std_periph EXPORT halStTargets)

if("${TARGET_MCU_FAMILY}" STREQUAL stm32f0xx)
target_link_libraries(hal_st.std_periph INTERFACE hal_st.atomic)
target_link_libraries(hal_st.std_periph INTERFACE hal_st.std_periph_stm32wbxx)
elseif("${TARGET_MCU_FAMILY}" STREQUAL stm32f2xx)
target_link_libraries(hal_st.std_periph INTERFACE hal_st.std_periph_stm32f2xx)
elseif("${TARGET_MCU_FAMILY}" STREQUAL stm32f3xx)
target_link_libraries(hal_st.std_periph INTERFACE hal_st.std_periph_stm32f3xx)
elseif("${TARGET_MCU_FAMILY}" STREQUAL stm32f4xx)
target_link_libraries(hal_st.std_periph INTERFACE hal_st.std_periph_stm32f4xx)
elseif("${TARGET_MCU_FAMILY}" STREQUAL stm32f7xx)
target_link_libraries(hal_st.std_periph INTERFACE hal_st.std_periph_stm32f7xx)
elseif("${TARGET_MCU_FAMILY}" STREQUAL stm32wbxx)
target_link_libraries(hal_st.std_periph INTERFACE hal_st.std_periph_stm32wbxx)
elseif(EMIL_HOST_BUILD)
target_link_libraries(hal_st.std_periph INTERFACE hal_st.cmsis_windows_stub)
endif()

target_link_libraries(hal_st.std_periph INTERFACE
$<$<STREQUAL:${TARGET_MCU_FAMILY},stm32f0xx>:hal_st.atomic>
$<$<STREQUAL:${TARGET_MCU_FAMILY},stm32f0xx>:hal_st.std_periph_stm32f0xx>
$<$<STREQUAL:${TARGET_MCU_FAMILY},stm32f2xx>:hal_st.std_periph_stm32f2xx>
$<$<STREQUAL:${TARGET_MCU_FAMILY},stm32f3xx>:hal_st.std_periph_stm32f3xx>
$<$<STREQUAL:${TARGET_MCU_FAMILY},stm32f4xx>:hal_st.std_periph_stm32f4xx>
$<$<STREQUAL:${TARGET_MCU_FAMILY},stm32f7xx>:hal_st.std_periph_stm32f7xx>
$<$<STREQUAL:${TARGET_MCU_FAMILY},stm32wbxx>:hal_st.std_periph_stm32wbxx>
$<TARGET_OBJECTS:hal_st.startup>
$<$<BOOL:${EMIL_HOST_BUILD}>:hal_st.cmsis_windows_stub>
)

add_library(hal_st.default_linker_scripts INTERFACE)
Expand Down
2 changes: 2 additions & 0 deletions hal_st/stm32fxxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ target_sources(hal_st.stm32fxxx PRIVATE
SpiDataSizeConfiguratorStm.hpp
$<$<NOT:$<STREQUAL:${TARGET_MCU},stm32wb55>>:SingleSpeedQuadSpiStmDma.cpp>
$<$<NOT:$<STREQUAL:${TARGET_MCU},stm32wb55>>:SingleSpeedQuadSpiStmDma.hpp>
SpiMasterStm.cpp
SpiMasterStm.hpp
$<$<NOT:$<STREQUAL:${TARGET_MCU},stm32wb55>>:SpiMasterStmDma.cpp>
$<$<NOT:$<STREQUAL:${TARGET_MCU},stm32wb55>>:SpiMasterStmDma.hpp>
$<$<NOT:$<STREQUAL:${TARGET_MCU},stm32wb55>>:SpiSlaveStmDma.cpp>
Expand Down