diff --git a/CMake/binutils.ChibiOS.cmake b/CMake/binutils.ChibiOS.cmake index 5a40350ca3..393332ac33 100644 --- a/CMake/binutils.ChibiOS.cmake +++ b/CMake/binutils.ChibiOS.cmake @@ -133,7 +133,7 @@ macro(nf_add_platform_dependencies target) ${TARGET_CHIBIOS_NANOCLR_INCLUDE_DIRS} ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD}) - if(CHIBIOS_COMMUNITY_TARGET) + if(IS_COMMUNITY_TARGET) target_include_directories(NF_CoreCLR PUBLIC ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD} ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}/nanoCLR) @@ -152,7 +152,7 @@ macro(nf_add_platform_dependencies target) ${TARGET_CHIBIOS_NANOCLR_INCLUDE_DIRS} ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD}) - if(CHIBIOS_COMMUNITY_TARGET) + if(IS_COMMUNITY_TARGET) target_include_directories(WireProtocol PUBLIC ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD} ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}/nanoCLR) @@ -174,7 +174,7 @@ macro(nf_add_platform_dependencies target) ${TARGET_CHIBIOS_NANOCLR_INCLUDE_DIRS} ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD}) - if(CHIBIOS_COMMUNITY_TARGET) + if(IS_COMMUNITY_TARGET) target_include_directories(NF_Debugger PUBLIC ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD} ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}/nanoCLR) @@ -197,7 +197,7 @@ macro(nf_add_platform_dependencies target) ${TARGET_CHIBIOS_NANOCLR_INCLUDE_DIRS} ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD}) - if(CHIBIOS_COMMUNITY_TARGET) + if(IS_COMMUNITY_TARGET) target_include_directories(NF_NativeAssemblies PUBLIC ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD} ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}/nanoCLR) @@ -226,7 +226,7 @@ macro(nf_add_platform_dependencies target) ${${TARGET_STM32_CUBE_PACKAGE}_CubePackage_INCLUDE_DIRS} EXTRA_COMPILE_DEFINITIONS -DHAL_USE_MAC=TRUE) - if(CHIBIOS_COMMUNITY_TARGET) + if(IS_COMMUNITY_TARGET) target_include_directories(NF_Network PUBLIC ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD} ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}/nanoCLR) @@ -258,7 +258,7 @@ macro(nf_add_platform_include_directories target) ${SPIFFS_INCLUDE_DIRS} ) - if(CHIBIOS_COMMUNITY_TARGET) + if(IS_COMMUNITY_TARGET) target_include_directories(${target}.elf PUBLIC ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD} ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}/nanoCLR) diff --git a/CMake/binutils.TI_SimpleLink.cmake b/CMake/binutils.TI_SimpleLink.cmake index 4d36144f4a..d529b47230 100644 --- a/CMake/binutils.TI_SimpleLink.cmake +++ b/CMake/binutils.TI_SimpleLink.cmake @@ -111,6 +111,13 @@ macro(nf_add_platform_dependencies target) ${TI_XDCTools_INCLUDE_DIR} ${TARGET_TI_SimpleLink_COMMON_INCLUDE_DIRS} ${TARGET_TI_SimpleLink_NANOCLR_INCLUDE_DIRS}) + + if(IS_COMMUNITY_TARGET) + target_include_directories(NF_CoreCLR PUBLIC + ${CMAKE_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD} + ${CMAKE_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD}/nanoCLR) + + endif() add_dependencies(${target}.elf nano::NF_CoreCLR) @@ -121,6 +128,13 @@ macro(nf_add_platform_dependencies target) ${TARGET_TI_SimpleLink_COMMON_INCLUDE_DIRS} ${TARGET_TI_SimpleLink_NANOCLR_INCLUDE_DIRS}) + if(IS_COMMUNITY_TARGET) + target_include_directories(WireProtocol PUBLIC + ${CMAKE_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD} + ${CMAKE_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD}/nanoCLR) + + endif() + add_dependencies(${target}.elf nano::WireProtocol) if(NF_FEATURE_DEBUGGER) @@ -132,6 +146,13 @@ macro(nf_add_platform_dependencies target) ${TARGET_TI_SimpleLink_NANOCLR_INCLUDE_DIRS}) add_dependencies(${target}.elf nano::NF_Debugger) + + if(IS_COMMUNITY_TARGET) + target_include_directories(NF_Debugger PUBLIC + ${CMAKE_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD} + ${CMAKE_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD}/nanoCLR) + + endif() endif() @@ -142,7 +163,14 @@ macro(nf_add_platform_dependencies target) ${TI_XDCTools_INCLUDE_DIR} ${TARGET_TI_SimpleLink_COMMON_INCLUDE_DIRS} ${TARGET_TI_SimpleLink_NANOCLR_INCLUDE_DIRS}) - + + if(IS_COMMUNITY_TARGET) + target_include_directories(NF_NativeAssemblies PUBLIC + ${CMAKE_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD} + ${CMAKE_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD}/nanoCLR) + + endif() + # add dependency from SysConfig and TI RTOS configs (this is required to make sure that the intermediate artifacts are generated in the proper order) add_dependencies(COPY_TIRTOS_CONFIG SYSCONFIG_TASKS) add_dependencies(TIRTOS_CONFIG COPY_TIRTOS_CONFIG) @@ -185,6 +213,13 @@ macro(nf_add_platform_include_directories target) ) + if(IS_COMMUNITY_TARGET) + target_include_directories(${target}.elf PUBLIC + ${CMAKE_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD} + ${CMAKE_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD}/nanoCLR) + + endif() + target_link_libraries( ${NANOCLR_PROJECT_NAME}.elf diff --git a/CMakeLists.txt b/CMakeLists.txt index 2af0331719..5bcf80837b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -770,6 +770,9 @@ endif() ################################################################# +# assume no community board... until proven otherwise +set(IS_COMMUNITY_TARGET FALSE CACHE INTERNAL "Community target flag") + ####################### # ChibiOS if(RTOS_CHIBIOS_CHECK) @@ -872,6 +875,9 @@ elseif(RTOS_TI_SIMPLELINK_CHECK) # try to find board in the Community targets folder if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD}) + + # set flag for this being a community board + set(IS_COMMUNITY_TARGET TRUE CACHE INTERNAL "Community target flag") # set target base location set(TARGET_BASE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/targets-community/TI_SimpleLink/${TARGET_BOARD}) diff --git a/targets/ChibiOS/CMakeLists.txt b/targets/ChibiOS/CMakeLists.txt index 0f02036459..5dff199797 100644 --- a/targets/ChibiOS/CMakeLists.txt +++ b/targets/ChibiOS/CMakeLists.txt @@ -305,9 +305,6 @@ include_directories( ${CMSIS_RTOS_INCLUDE_DIR}) # need to find board definition files (board.c and board.h) -# assume no community board... until proven otherwise -set(CHIBIOS_COMMUNITY_TARGET FALSE CACHE INTERNAL "Community target flag") - # start search in nanoFramework ChibiOS 'overlay' folder if(EXISTS ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/boards/${TARGET_BOARD}) # board found @@ -349,7 +346,7 @@ else() # try to find board in the Community targets folder if(EXISTS ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}) # set flag for this being a community board - set(CHIBIOS_COMMUNITY_TARGET TRUE CACHE INTERNAL "Community target flag") + set(IS_COMMUNITY_TARGET TRUE CACHE INTERNAL "Community target flag") # check if the board definition files are available at the target folder diff --git a/targets/ChibiOS/_include/CMakeLists.txt b/targets/ChibiOS/_include/CMakeLists.txt index fa134507ac..db2349241b 100644 --- a/targets/ChibiOS/_include/CMakeLists.txt +++ b/targets/ChibiOS/_include/CMakeLists.txt @@ -11,7 +11,7 @@ list(APPEND TARGET_CHIBIOS_COMMON_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/targets/${RTO set(TARGET_CHIBIOS_COMMON_INCLUDE_DIRS ${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS} CACHE INTERNAL "make global") # add headers with target platform definitions and SWO -if(CHIBIOS_COMMUNITY_TARGET) +if(IS_COMMUNITY_TARGET) configure_file(${CMAKE_SOURCE_DIR}/CMake/ChibiOS_target_os.h.in ${CMAKE_BINARY_DIR}/targets/${RTOS}/${TARGET_BOARD}/target_os.h @ONLY)