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:
Sam Sortais
2017-07-10 13:12:25 -07:00
committed by Wendy Liang
parent f9c58ff54b
commit 591ccb5c8a
3 changed files with 16 additions and 0 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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")