Introduces Regression for 32 and 64 bit threadx and smp kernel in Debug, MinSizeRel and Release configuration #4
@@ -40,14 +40,24 @@ add_subdirectory(port/moonlight)
|
||||
|
||||
function(setup_target TARGET)
|
||||
set(options)
|
||||
set(oneValueArgs) # none for now
|
||||
set(oneValueArgs OUTPUT_DIR TARGET_MEM)
|
||||
set(multiValueArgs LIBRARIES SOURCES)
|
||||
cmake_parse_arguments(ST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
if(ST_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "setup_target(${TARGET} ...): unknown args: ${ST_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
|
||||
if(NOT ST_OUTPUT_DIR)
|
||||
set(ST_OUTPUT_DIR ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
if(NOT ST_TARGET_MEM)
|
||||
set(ST_TARGET_MEM ${TARGET_MEM})
|
||||
endif()
|
||||
|
||||
add_executable(${TARGET})
|
||||
set_target_properties(${TARGET} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${ST_OUTPUT_DIR}
|
||||
)
|
||||
target_add_moonlight_platform(${TARGET})
|
||||
|
||||
if("netxduo" IN_LIST ST_LIBRARIES)
|
||||
@@ -63,13 +73,17 @@ function(setup_target TARGET)
|
||||
endif()
|
||||
|
||||
target_link_options(${TARGET} PRIVATE
|
||||
-Wl,-Map=${CMAKE_BINARY_DIR}/${TARGET}.map)
|
||||
-nostartfiles
|
||||
-nostdlib
|
||||
-T ${CMAKE_SOURCE_DIR}/src/${ST_TARGET_MEM}.lds
|
||||
-Wl,--gc-sections
|
||||
-Wl,-Map=${ST_OUTPUT_DIR}/${TARGET}.map)
|
||||
|
||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||
COMMAND ${OBJCOPY} -O ihex $<TARGET_FILE:${TARGET}> ${CMAKE_BINARY_DIR}/${TARGET}.hex
|
||||
COMMAND ${OBJCOPY} -O binary $<TARGET_FILE:${TARGET}> ${CMAKE_BINARY_DIR}/${TARGET}.bin
|
||||
COMMAND ${OBJCOPY} -O ihex $<TARGET_FILE:${TARGET}> ${ST_OUTPUT_DIR}/${TARGET}.hex
|
||||
COMMAND ${OBJCOPY} -O binary $<TARGET_FILE:${TARGET}> ${ST_OUTPUT_DIR}/${TARGET}.bin
|
||||
COMMAND ${SIZE} $<TARGET_FILE:${TARGET}>
|
||||
COMMAND ${OBJDUMP} -S $<TARGET_FILE:${TARGET}> > ${TARGET}.dis
|
||||
COMMAND ${OBJDUMP} -S $<TARGET_FILE:${TARGET}> > ${ST_OUTPUT_DIR}/${TARGET}.dis
|
||||
COMMENT "Creating collateral for ${TARGET}"
|
||||
)
|
||||
endfunction()
|
||||
|
||||
@@ -22,11 +22,6 @@ target_compile_options(moonlight_platform_defaults INTERFACE
|
||||
-ffunction-sections)
|
||||
target_link_directories(moonlight_platform_defaults INTERFACE
|
||||
${THREADX4TGFS_ROOT}/src)
|
||||
target_link_options(moonlight_platform_defaults INTERFACE
|
||||
-nostartfiles
|
||||
-nostdlib
|
||||
-T ${THREADX4TGFS_ROOT}/src/${TARGET_MEM}.lds
|
||||
-Wl,--gc-sections)
|
||||
if(NX_DEBUG)
|
||||
target_compile_definitions(moonlight_platform_defaults INTERFACE
|
||||
NX_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user