clang skip mcx since it does not work any more with gcc
This commit is contained in:
14
.github/workflows/cmake_arm.yml
vendored
14
.github/workflows/cmake_arm.yml
vendored
@@ -79,11 +79,13 @@ jobs:
|
|||||||
ref: develop
|
ref: develop
|
||||||
path: pico-sdk
|
path: pico-sdk
|
||||||
|
|
||||||
- name: Build
|
- name: Get Dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y ninja-build
|
sudo apt install -y ninja-build
|
||||||
python3 tools/get_deps.py ${{ matrix.family }}
|
python3 tools/get_deps.py ${{ matrix.family }}
|
||||||
python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel
|
|
||||||
|
- name: Build
|
||||||
|
run: python tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=clang -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||||
env:
|
env:
|
||||||
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
|
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
|
||||||
|
|
||||||
@@ -125,7 +127,7 @@ jobs:
|
|||||||
- 'kinetis_k kinetis_kl'
|
- 'kinetis_k kinetis_kl'
|
||||||
- 'lpc17 lpc18 lpc40 lpc43'
|
- 'lpc17 lpc18 lpc40 lpc43'
|
||||||
- 'lpc54 lpc55'
|
- 'lpc54 lpc55'
|
||||||
- 'mcx'
|
#- 'mcx' not working with gcc anymore, need to fix this first
|
||||||
- 'nrf'
|
- 'nrf'
|
||||||
- 'ra'
|
- 'ra'
|
||||||
- 'rp2040'
|
- 'rp2040'
|
||||||
@@ -178,11 +180,13 @@ jobs:
|
|||||||
ref: develop
|
ref: develop
|
||||||
path: pico-sdk
|
path: pico-sdk
|
||||||
|
|
||||||
- name: Build
|
- name: Get Dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y ninja-build
|
sudo apt install -y ninja-build
|
||||||
python3 tools/get_deps.py ${{ matrix.family }}
|
python3 tools/get_deps.py ${{ matrix.family }}
|
||||||
python tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=clang -DCMAKE_BUILD_TYPE=MinSizeRel
|
|
||||||
|
- name: Build
|
||||||
|
run: python tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=clang -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||||
env:
|
env:
|
||||||
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
|
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
|
||||||
|
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
include_guard()
|
include_guard()
|
||||||
|
|
||||||
if (NOT BOARD)
|
|
||||||
message(FATAL_ERROR "BOARD not specified")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
set(SDK_DIR ${TOP}/hw/mcu/nxp/mcux-sdk)
|
set(SDK_DIR ${TOP}/hw/mcu/nxp/mcux-sdk)
|
||||||
set(CMSIS_DIR ${TOP}/lib/CMSIS_5)
|
set(CMSIS_DIR ${TOP}/lib/CMSIS_5)
|
||||||
|
|
||||||
@@ -28,60 +24,63 @@ set(CMAKE_TOOLCHAIN_FILE ${TOP}/examples/build_system/cmake/toolchain/arm_${TOOL
|
|||||||
#------------------------------------
|
#------------------------------------
|
||||||
# only need to be built ONCE for all examples
|
# only need to be built ONCE for all examples
|
||||||
function(add_board_target BOARD_TARGET)
|
function(add_board_target BOARD_TARGET)
|
||||||
if (NOT TARGET ${BOARD_TARGET})
|
if (TARGET ${BOARD_TARGET})
|
||||||
add_library(${BOARD_TARGET} STATIC
|
return()
|
||||||
# external driver
|
endif()
|
||||||
#lib/sct_neopixel/sct_neopixel.c
|
|
||||||
|
|
||||||
# driver
|
if (NOT DEFINED LD_FILE_GNU)
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_gpio.c
|
set(LD_FILE_GNU ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/${MCU_CORE}_flash.ld)
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_common_arm.c
|
endif ()
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_lpuart.c
|
set(LD_FILE_Clang ${LD_FILE_GNU})
|
||||||
|
|
||||||
# mcu
|
if (NOT DEFINED STARTUP_FILE_GNU)
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_clock.c
|
set(STARTUP_FILE_GNU ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/startup_${MCU_CORE}.S)
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_reset.c
|
endif()
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}/system_${MCU_CORE}.c
|
set(STARTUP_FILE_Clang ${STARTUP_FILE_GNU})
|
||||||
|
|
||||||
|
add_library(${BOARD_TARGET} STATIC
|
||||||
|
${STARTUP_FILE_${CMAKE_C_COMPILER_ID}}
|
||||||
|
# driver
|
||||||
|
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_gpio.c
|
||||||
|
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_common_arm.c
|
||||||
|
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_lpuart.c
|
||||||
|
# mcu
|
||||||
|
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_clock.c
|
||||||
|
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_reset.c
|
||||||
|
${SDK_DIR}/devices/${MCU_VARIANT}/system_${MCU_CORE}.c
|
||||||
|
)
|
||||||
|
target_include_directories(${BOARD_TARGET} PUBLIC
|
||||||
|
${CMSIS_DIR}/CMSIS/Core/Include
|
||||||
|
${SDK_DIR}/devices/${MCU_VARIANT}
|
||||||
|
${SDK_DIR}/devices/${MCU_VARIANT}/drivers
|
||||||
|
)
|
||||||
|
|
||||||
|
if (${FAMILY_MCUS} STREQUAL "MCXN9")
|
||||||
|
target_sources(${BOARD_TARGET} PRIVATE
|
||||||
|
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_lpflexcomm.c
|
||||||
|
)
|
||||||
|
elseif(${FAMILY_MCUS} STREQUAL "MCXA15")
|
||||||
|
target_sources(${BOARD_TARGET} PRIVATE
|
||||||
|
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_spc.c
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
update_board(${BOARD_TARGET})
|
||||||
|
|
||||||
|
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_link_options(${BOARD_TARGET} PUBLIC
|
||||||
|
"LINKER:--script=${LD_FILE_GNU}"
|
||||||
|
--specs=nosys.specs --specs=nano.specs
|
||||||
|
#-nostartfiles
|
||||||
)
|
)
|
||||||
|
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
if (${FAMILY_MCUS} STREQUAL "MCXN9")
|
target_link_options(${BOARD_TARGET} PUBLIC
|
||||||
target_sources(${BOARD_TARGET} PRIVATE
|
"LINKER:--script=${LD_FILE_Clang}"
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_lpflexcomm.c
|
|
||||||
)
|
|
||||||
elseif(${FAMILY_MCUS} STREQUAL "MCXA15")
|
|
||||||
target_sources(${BOARD_TARGET} PRIVATE
|
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_spc.c
|
|
||||||
)
|
)
|
||||||
endif()
|
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
|
||||||
|
target_link_options(${BOARD_TARGET} PUBLIC
|
||||||
# target_compile_definitions(${BOARD_TARGET} PUBLIC
|
"LINKER:--config=${LD_FILE_IAR}"
|
||||||
# )
|
|
||||||
target_include_directories(${BOARD_TARGET} PUBLIC
|
|
||||||
# driver
|
|
||||||
# mcu
|
|
||||||
${CMSIS_DIR}/CMSIS/Core/Include
|
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}
|
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers
|
|
||||||
)
|
)
|
||||||
|
|
||||||
update_board(${BOARD_TARGET})
|
|
||||||
|
|
||||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
|
||||||
target_sources(${BOARD_TARGET} PUBLIC
|
|
||||||
${SDK_DIR}/devices/${MCU_VARIANT}/gcc/startup_${MCU_CORE}.S
|
|
||||||
)
|
|
||||||
target_link_options(${BOARD_TARGET} PUBLIC
|
|
||||||
# linker file
|
|
||||||
"LINKER:--script=${SDK_DIR}/devices/${MCU_VARIANT}/gcc/${MCU_CORE}_flash.ld"
|
|
||||||
# nanolib
|
|
||||||
--specs=nosys.specs
|
|
||||||
--specs=nano.specs
|
|
||||||
)
|
|
||||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
|
|
||||||
target_link_options(${BOARD_TARGET} PUBLIC
|
|
||||||
"LINKER:--config=${LD_FILE_IAR}"
|
|
||||||
)
|
|
||||||
endif ()
|
|
||||||
endif ()
|
endif ()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user