@@ -43,6 +43,7 @@ endif ()
4343if (NOT DEFINED LD_FILE_GNU)
4444set (LD_FILE_GNU ${LD_FILE_GNU_DEFAULT} )
4545endif ()
46+ set (LD_FILE_Clang ${LD_FILE_GNU} )
4647
4748#------------------------------------
4849# Board Target
@@ -112,37 +113,40 @@ function(family_configure_example TARGET RTOS)
112113 family_configure_common(${TARGET} ${RTOS} )
113114 family_add_tinyusb(${TARGET} OPT_MCU_${FAMILY_MCUS} )
114115
115- target_sources (${TARGET} PUBLIC
116+ target_sources (${TARGET} PRIVATE
116117 ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /family.c
117118 ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /../board.c
118119 ${TOP} /src/portable/nordic/nrf5x/dcd_nrf5x.c
119120 ${TOP} /src/portable/synopsys/dwc2/dcd_dwc2.c
120121 ${TOP} /src/portable/synopsys/dwc2/hcd_dwc2.c
121122 ${TOP} /src/portable/synopsys/dwc2/dwc2_common.c
122- ${STARTUP_FILE_${CMAKE_C_COMPILER_ID} }
123123 )
124124 target_include_directories (${TARGET} PUBLIC
125125 ${CMAKE_CURRENT_FUNCTION_LIST_DIR}
126126 ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /../../
127127 ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /boards/${BOARD}
128128 )
129129
130- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" )
131- target_link_options (${TARGET} PUBLIC
132- "LINKER:--script=${LD_FILE_GNU} "
133- -L${NRFX_PATH} /mdk
134- --specs=nosys.specs --specs=nano.specs
135- -nostartfiles
136- )
137- elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang" )
138- target_link_options (${TARGET} PUBLIC
139- "LINKER:--script=${LD_FILE_GNU} "
140- -L${NRFX_PATH} /mdk
141- )
142- elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR" )
143- target_link_options (${TARGET} PUBLIC
144- "LINKER:--config=${LD_FILE_IAR} "
145- )
130+ if (NOT RTOS STREQUAL zephyr)
131+ target_sources (${TARGET} PRIVATE ${STARTUP_FILE_${CMAKE_C_COMPILER_ID} })
132+
133+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" )
134+ target_link_options (${TARGET} PUBLIC
135+ "LINKER:--script=${LD_FILE_GNU} "
136+ -L${NRFX_PATH} /mdk
137+ --specs=nosys.specs --specs=nano.specs
138+ -nostartfiles
139+ )
140+ elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang" )
141+ target_link_options (${TARGET} PUBLIC
142+ "LINKER:--script=${LD_FILE_GNU} "
143+ -L${NRFX_PATH} /mdk
144+ )
145+ elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR" )
146+ target_link_options (${TARGET} PUBLIC
147+ "LINKER:--config=${LD_FILE_IAR} "
148+ )
149+ endif ()
146150 endif ()
147151
148152 if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" )
0 commit comments