From 591ccb5c8aa7d221ff6441bbd6c3a90ef10fb28e Mon Sep 17 00:00:00 2001 From: Sam Sortais Date: Mon, 10 Jul 2017 13:12:25 -0700 Subject: [PATCH] libmetal_demo: cmake, add PROJECT_EC_FLAGS Add option for user to provide additional ecf from command line. Signed-off-by: Sam Sortais --- .../freertos/zynqmp_r5/zynqmp_amp_demo/CMakeLists.txt | 4 ++++ .../generic/zynqmp_r5/zynqmp_amp_demo/CMakeLists.txt | 4 ++++ .../system/linux/zynqmp/zynqmp_amp_demo/CMakeLists.txt | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/examples/system/freertos/zynqmp_r5/zynqmp_amp_demo/CMakeLists.txt b/examples/system/freertos/zynqmp_r5/zynqmp_amp_demo/CMakeLists.txt index 1aff6dd..0a2aafa 100644 --- a/examples/system/freertos/zynqmp_r5/zynqmp_amp_demo/CMakeLists.txt +++ b/examples/system/freertos/zynqmp_r5/zynqmp_amp_demo/CMakeLists.txt @@ -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) diff --git a/examples/system/generic/zynqmp_r5/zynqmp_amp_demo/CMakeLists.txt b/examples/system/generic/zynqmp_r5/zynqmp_amp_demo/CMakeLists.txt index 1aff6dd..0a2aafa 100644 --- a/examples/system/generic/zynqmp_r5/zynqmp_amp_demo/CMakeLists.txt +++ b/examples/system/generic/zynqmp_r5/zynqmp_amp_demo/CMakeLists.txt @@ -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) diff --git a/examples/system/linux/zynqmp/zynqmp_amp_demo/CMakeLists.txt b/examples/system/linux/zynqmp/zynqmp_amp_demo/CMakeLists.txt index d488d48..80abc04 100644 --- a/examples/system/linux/zynqmp/zynqmp_amp_demo/CMakeLists.txt +++ b/examples/system/linux/zynqmp/zynqmp_amp_demo/CMakeLists.txt @@ -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")