Skip to content

xbmgmt2: use XBMGMT2_NAME in XRT_EDGE target_compile_definitions#9830

Open
talhaHavadar wants to merge 1 commit into
Xilinx:masterfrom
talhaHavadar:fix-xbmgmt2-xrt-edge-target-name
Open

xbmgmt2: use XBMGMT2_NAME in XRT_EDGE target_compile_definitions#9830
talhaHavadar wants to merge 1 commit into
Xilinx:masterfrom
talhaHavadar:fix-xbmgmt2-xrt-edge-target-name

Conversation

@talhaHavadar
Copy link
Copy Markdown

Fixes #9829.

Summary

src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt references ${XBUTIL2_NAME} in its XRT_EDGE branch when calling target_compile_definitions. XBUTIL2_NAME is defined in the sibling xbutil2/CMakeLists.txt and is not visible in this directory scope, so it expands to an empty string. CMake then parses the call as target_compile_definitions(PRIVATE ENABLE_DEFAULT_ONE_DEVICE_OPTION) and aborts configure with:

CMake Error at src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt:68 (target_compile_definitions):
  Cannot specify compile definitions for target "PRIVATE" which is not built
  by this project.

The non-edge branch above already uses the correct ${XBMGMT2_NAME}. This change makes the edge branch consistent.

Reproduction (before this PR)

cmake -S src -B build -DXRT_EDGE=ON -DXRT_AIE_BUILD=ON

Configure fails as above. With this patch, configure proceeds past xbmgmt2.

Impact

  • Configure fails for any build that sets -DXRT_EDGE=ON (arm64 / edge / Zynq).
  • Native PCIe builds (-DXRT_EDGE unset or OFF) are unaffected — the else-branch is never entered.

Notes

  • One-line cmake fix, no behavioural change for the non-edge path.
  • DCO sign-off added in commit.

The XRT_EDGE branch of xbmgmt2/CMakeLists.txt references ${XBUTIL2_NAME}
when calling target_compile_definitions. That variable is defined in the
sibling xbutil2/CMakeLists.txt and is not visible in this directory
scope, so it expands to an empty string. CMake then parses the call as
target_compile_definitions(PRIVATE ENABLE_DEFAULT_ONE_DEVICE_OPTION) and
fails the configure step with:

    Cannot specify compile definitions for target "PRIVATE" which is
    not built by this project.

The non-edge branch above already uses the correct ${XBMGMT2_NAME}.
Replace the ${XBUTIL2_NAME} reference with ${XBMGMT2_NAME} so the
compile definition is applied to the xbmgmt executable built in this
directory.

Fixes: Xilinx#9829
Signed-off-by: Talha Can Havadar <havadartalha@gmail.com>
@xrt-pr-bot
Copy link
Copy Markdown

xrt-pr-bot Bot commented May 25, 2026

⚠️ Authorization Failed

@talhaHavadar is not a repository collaborator.

To proceed:

  • XRT Admins: Add the build label to authorize this PR build
  • OR Add @talhaHavadar as a repository collaborator

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Copy Markdown
Collaborator

@chvamshi-xilinx chvamshi-xilinx left a comment

Choose a reason for hiding this comment

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

xbmgmt is not compiled for EDGE flows. I think, we should remove the else part completely.

@@ -65,7 +65,7 @@ add_executable(${XBMGMT2_NAME} ${XBMGMT_V2_SRCS})
if (NOT XRT_EDGE)
target_compile_definitions(${XBMGMT2_NAME} PRIVATE ENABLE_NATIVE_SUBCMDS_AND_REPORTS)
else()
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.

Agree with removing else() entirely. Edge handling already lives in xbutil2/CMakeLists.txt. xbmgmt2 is only built for XRT_XRT/XRT_ALVEO, and no xbmgmt2 source uses that macro. so, we can drop this else()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xbmgmt2: configure fails with -DXRT_EDGE=ON due to wrong target variable

3 participants