legacy_apps: xlnx: fix build system for native cmake build#107
Conversation
| set (_app matrix_multiplyd) | ||
| else() | ||
| message(FATAL_ERROR "OPENAMP_APP_NAME not picked up") | ||
| add_subdirectory(${PROJECT_MACHINE}) |
There was a problem hiding this comment.
There was a problem hiding this comment.
HI @arnopo that addition is only used when OPENAMP_APP_NAME variable is passed, which will be passed via Xilinx's tools (Vitis).
This patch is needed if we want to build with native cmake flow, without Xilinx's tools.
Thanks,
Tanmay
There was a problem hiding this comment.
My mistake, I missed the return() just after that. That is one reason why I am not a fan of return() in CMake 😄
could you add a comment in code and/or commit explaining why you skip the rest of the cmake?
An alternative to avoid the return (only a suggestion you can ignore):
set(_build_demo ON)
if(OPENAMP_APP_NAME STREQUAL "rpc_demo")
set(_app rpc_demo)
elseif(OPENAMP_APP_NAME STREQUAL "echo")
set(_app rpmsg-echo)
elseif(OPENAMP_APP_NAME STREQUAL "matrix_multiply")
set(_app matrix_multiplyd)
else()
add_subdirectory(${PROJECT_MACHINE})
set(_build_demo OFF)
endif()
if(_build_demo)
message("OpenAMP: OPENAMP_APP_NAME: ${OPENAMP_APP_NAME}")
[...]
endif()There was a problem hiding this comment.
Thanks. I liked the idea. I will just use different variable name.
i.e. %s/_build_demo/_vitis_build/
There was a problem hiding this comment.
Updated the commit.
OPENAMP_APP_NAME variable is needed for xilinx specific build tools. Native cmake build doesn't need this variable, and so if it's not found then do not fail, and include project machine direcotry. This allows native cmake build to continue. Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
c538fc5 to
fd186d9
Compare
OPENAMP_APP_NAME variable is needed for xilinx specific build tools. Native cmake build doesn't need this variable, and so if it's not found then do not fail, and include project machine direcotry. This allows native cmake build to continue.