Skip to content

Commit

Permalink
Update FindCMSIS.cmake
Browse files Browse the repository at this point in the history
Wrap CMSIS_LD_.... with if to check if allready exsists
  • Loading branch information
nische authored Jun 5, 2024
1 parent 369b66d commit 3c8b57a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmake/FindCMSIS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ function(cmsis_generate_default_linker_script FAMILY DEVICE CORE)
-P "${STM32_CMAKE_DIR}/stm32/linker_ld.cmake"
)
endif()
add_custom_target(CMSIS_LD_${DEVICE}${CORE_U} DEPENDS "${OUTPUT_LD_FILE}")
add_dependencies(CMSIS::STM32::${DEVICE}${CORE_C} CMSIS_LD_${DEVICE}${CORE_U})
stm32_add_linker_script(CMSIS::STM32::${DEVICE}${CORE_C} INTERFACE "${OUTPUT_LD_FILE}")
if (NOT TARGET CMSIS_LD_${DEVICE}${CORE_U})
add_custom_target(CMSIS_LD_${DEVICE}${CORE_U} DEPENDS "${OUTPUT_LD_FILE}")
add_dependencies(CMSIS::STM32::${DEVICE}${CORE_C} CMSIS_LD_${DEVICE}${CORE_U})
stm32_add_linker_script(CMSIS::STM32::${DEVICE}${CORE_C} INTERFACE "${OUTPUT_LD_FILE}")
endif()
endfunction()

foreach(COMP ${CMSIS_FIND_COMPONENTS_FAMILIES})
Expand Down

0 comments on commit 3c8b57a

Please sign in to comment.