cmake: Fix new wut_create_rpl for RPL files.

Forgot RPL was a thing, was only working for RPX before.
This commit is contained in:
James Benton 2019-11-23 10:10:18 +00:00
parent 35c20d8700
commit 217bf98474

View File

@ -56,7 +56,7 @@ function(wut_create_rpl_deprecated target source)
COMMAND ${CMAKE_STRIP} -g ${source} COMMAND ${CMAKE_STRIP} -g ${source}
COMMAND ${WUT_ELF2RPL} ${ELF2RPL_FLAGS} ${source} ${target} COMMAND ${WUT_ELF2RPL} ${ELF2RPL_FLAGS} ${source} ${target}
DEPENDS ${source} DEPENDS ${source}
COMMENT "Converting to RPX ${target}") COMMENT "Creating ${target}")
add_dependencies(${target} ${source}) add_dependencies(${target} ${source})
endfunction() endfunction()
@ -68,23 +68,25 @@ function(wut_create_rpl target)
cmake_parse_arguments(RPL "${RPL_OPTIONS}" "${RPL_SINGLE_ARGS}" "${RPL_MULTI_ARGS}" "${ARGN}") cmake_parse_arguments(RPL "${RPL_OPTIONS}" "${RPL_SINGLE_ARGS}" "${RPL_MULTI_ARGS}" "${ARGN}")
if(${ARGC} GREATER 1 AND NOT "${ARGV1}" STREQUAL "IS_RPX") if(${ARGC} GREATER 1 AND NOT "${ARGV1}" STREQUAL "IS_RPX")
message(DEPRECATION "wut_create_rpl(dest.rpx source) is deprecated, prefer using wut_create_rpl(target)") message(DEPRECATION "wut_create_rpl(dest source) is deprecated, prefer using wut_create_rpl(target) or wut_create_rpx(target)")
wut_create_rpl_deprecated(${ARGV0} ${ARGV1} ${RPL_OPTIONS}) wut_create_rpl_deprecated(${ARGV})
return() return()
endif() endif()
if(RPL_IS_RPX) if(RPL_IS_RPX)
# Do nothing - the defaults are good for RPX # Do nothing - the defaults are good for RPX
set(RPL_SUFFIX "rpx")
else() else()
set(ELF2RPL_FLAGS ${ELF2RPL_FLAGS} --rpl) set(ELF2RPL_FLAGS ${ELF2RPL_FLAGS} --rpl)
set_property(TARGET ${target} APPEND_STRING PROPERTY set_property(TARGET ${target} APPEND_STRING PROPERTY
LINK_FLAGS "-specs=${WUT_ROOT}/share/rpl.specs") LINK_FLAGS "-specs=${WUT_ROOT}/share/rpl.specs")
set(RPL_SUFFIX "rpl")
endif() endif()
add_custom_command(TARGET ${target} POST_BUILD add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_STRIP} -g $<TARGET_FILE:${target}> COMMAND ${CMAKE_STRIP} -g $<TARGET_FILE:${target}>
COMMAND ${WUT_ELF2RPL} ${ELF2RPL_FLAGS} $<TARGET_FILE:${target}> $<TARGET_FILE_DIR:${target}>/${target}.rpx COMMAND ${WUT_ELF2RPL} ${ELF2RPL_FLAGS} $<TARGET_FILE:${target}> $<TARGET_FILE_DIR:${target}>/${target}.${RPL_SUFFIX}
COMMENT "Creating ${target}.rpx") COMMENT "Creating ${target}.${RPL_SUFFIX}")
endfunction() endfunction()
function(wut_create_rpx) function(wut_create_rpx)