mirror of
https://github.com/OpenAMP/libmetal.git
synced 2026-02-06 20:12:33 +08:00
libmetal_demo: cmake, add PROJECT_EC_FLAGS
Add option for user to provide additional ecf from command line. Signed-off-by: Sam Sortais <sam.sortais@xilinx.com>
This commit is contained in:
@@ -15,6 +15,10 @@ list(APPEND _src0 ${CMAKE_CURRENT_SOURCE_DIR}/sys_init.c)
|
||||
|
||||
get_property (_linker_options GLOBAL PROPERTY TEST_LINKER_OPTIONS)
|
||||
add_executable (${_app0}.elf ${_src0})
|
||||
if (PROJECT_EC_FLAGS)
|
||||
string(REPLACE " " ";" _ec_flgs ${PROJECT_EC_FLAGS})
|
||||
target_compile_options (${_app0}.elf PUBLIC ${_ec_flgs})
|
||||
endif (PROJECT_EC_FLAGS)
|
||||
target_link_libraries(${_app0}.elf -Wl,-Map=${_app0}.map -Wl,--gc-sections -T\"${_linker_script}\" -Wl,--start-group ${_deps} -Wl,--end-group)
|
||||
install (TARGETS ${_app0}.elf RUNTIME DESTINATION bin)
|
||||
|
||||
|
||||
@@ -15,6 +15,10 @@ list(APPEND _src0 ${CMAKE_CURRENT_SOURCE_DIR}/sys_init.c)
|
||||
|
||||
get_property (_linker_options GLOBAL PROPERTY TEST_LINKER_OPTIONS)
|
||||
add_executable (${_app0}.elf ${_src0})
|
||||
if (PROJECT_EC_FLAGS)
|
||||
string(REPLACE " " ";" _ec_flgs ${PROJECT_EC_FLAGS})
|
||||
target_compile_options (${_app0}.elf PUBLIC ${_ec_flgs})
|
||||
endif (PROJECT_EC_FLAGS)
|
||||
target_link_libraries(${_app0}.elf -Wl,-Map=${_app0}.map -Wl,--gc-sections -T\"${_linker_script}\" -Wl,--start-group ${_deps} -Wl,--end-group)
|
||||
install (TARGETS ${_app0}.elf RUNTIME DESTINATION bin)
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@ foreach (_app libmetal_amp_demo libmetal_amp_demod)
|
||||
|
||||
if (WITH_SHARED_LIB)
|
||||
add_executable (${_app}-share ${_src})
|
||||
if (PROJECT_EC_FLAGS)
|
||||
string(REPLACE " " ";" _ec_flgs ${PROJECT_EC_FLAGS})
|
||||
target_compile_options (${_app}-share PUBLIC ${_ec_flgs})
|
||||
endif (PROJECT_EC_FLAGS)
|
||||
target_link_libraries (${_app}-share ${PROJECT_NAME}-shared ${_deps})
|
||||
install (TARGETS ${_app}-share RUNTIME DESTINATION bin)
|
||||
add_dependencies (${_app}-share ${PROJECT_NAME}-shared)
|
||||
@@ -21,6 +25,10 @@ foreach (_app libmetal_amp_demo libmetal_amp_demod)
|
||||
if (WITH_STATIC_LIB)
|
||||
if (${PROJECT_SYSTEM} STREQUAL "linux")
|
||||
add_executable (${_app}-static ${_src})
|
||||
if (PROJECT_EC_FLAGS)
|
||||
string(REPLACE " " ";" _ec_flgs ${PROJECT_EC_FLAGS})
|
||||
target_compile_options (${_app}-static PUBLIC ${_ec_flgs})
|
||||
endif (PROJECT_EC_FLAGS)
|
||||
target_link_libraries (${_app}-static ${PROJECT_NAME}-static ${_deps})
|
||||
install (TARGETS ${_app}-static RUNTIME DESTINATION bin)
|
||||
endif (${PROJECT_SYSTEM} STREQUAL "linux")
|
||||
|
||||
Reference in New Issue
Block a user