Skip to content

legacy_apps: xlnx: fix build system for native cmake build#107

Open
tnmysh wants to merge 1 commit into
OpenAMP:mainfrom
tnmysh:fix_native_cmake_build
Open

legacy_apps: xlnx: fix build system for native cmake build#107
tnmysh wants to merge 1 commit into
OpenAMP:mainfrom
tnmysh:fix_native_cmake_build

Conversation

@tnmysh
Copy link
Copy Markdown
Collaborator

@tnmysh tnmysh commented May 12, 2026

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.

set (_app matrix_multiplyd)
else()
message(FATAL_ERROR "OPENAMP_APP_NAME not picked up")
add_subdirectory(${PROJECT_MACHINE})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I liked the idea. I will just use different variable name.

i.e. %s/_build_demo/_vitis_build/

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@tnmysh tnmysh force-pushed the fix_native_cmake_build branch from c538fc5 to fd186d9 Compare May 14, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants