diff --git a/build/build-win22.sh b/build/build-win22.sh index 31186b82b17..a9dd640e414 100644 --- a/build/build-win22.sh +++ b/build/build-win22.sh @@ -95,7 +95,6 @@ while [ $# -gt 0 ]; do -npu) shift npu_build=1 - cmake_flags+=" -DXDP_CLIENT_BUILD_CMAKE=yes" cmake_flags+=" -DXRT_NPU=1" ;; -j) diff --git a/build/build.sh b/build/build.sh index 9734e62b64a..17fc73086c5 100755 --- a/build/build.sh +++ b/build/build.sh @@ -172,7 +172,6 @@ while [ $# -gt 0 ]; do shift npu_build=1 noert=1 - cmake_flags+=" -DXDP_CLIENT_BUILD_CMAKE=yes" cmake_flags+=" -DXRT_NPU=1" ;; -opt) diff --git a/src/CMake/embedded_system.cmake b/src/CMake/embedded_system.cmake index 701a899b9bd..b15f47c23ae 100644 --- a/src/CMake/embedded_system.cmake +++ b/src/CMake/embedded_system.cmake @@ -41,6 +41,9 @@ endif(GIT_FOUND) set(LINUX_FLAVOR ${CMAKE_SYSTEM_NAME}) set(LINUX_KERNEL_VERSION ${CMAKE_SYSTEM_VERSION}) +# --- Set up what components of XRT to build --- +include(CMake/components.cmake) + # --- Boost Libraries --- include (CMake/boostUtil.cmake) diff --git a/src/runtime_src/CMakeLists.txt b/src/runtime_src/CMakeLists.txt index 8ea050a58b0..9266f916e68 100644 --- a/src/runtime_src/CMakeLists.txt +++ b/src/runtime_src/CMakeLists.txt @@ -76,7 +76,7 @@ else() add_compile_options( ${XRT_WARN_OPTS} ) endif() - if (XDP_CLIENT_BUILD_CMAKE STREQUAL "yes") + if (XRT_NPU) set(AIERT_DIR ${CMAKE_CURRENT_BINARY_DIR}/aie-rt/driver/src) set(XAIENGINE_BUILD_SHARED OFF) xrt_add_subdirectory_disable_install_target(aie-rt/driver/src) diff --git a/src/runtime_src/core/common/xdp/CMakeLists.txt b/src/runtime_src/core/common/xdp/CMakeLists.txt index 3fe9cd48bc4..5c3e2163698 100644 --- a/src/runtime_src/core/common/xdp/CMakeLists.txt +++ b/src/runtime_src/core/common/xdp/CMakeLists.txt @@ -9,15 +9,22 @@ target_include_directories(core_common_xdp_profile_objects ${XRT_SOURCE_DIR}/runtime_src ) -if (XDP_CLIENT_BUILD_CMAKE STREQUAL "yes") +# Compile defintions when building npu, alveo, or legacy xrt +# components +if (XRT_NPU) + target_compile_definitions(core_common_xdp_profile_objects PRIVATE XDP_CLIENT_BUILD=1 ) - + elseif (XDP_VE2_BUILD_CMAKE STREQUAL "yes") - target_compile_definitions(core_common_xdp_profile_objects - PRIVATE - XDP_VE2_BUILD=1 - ) + + target_compile_definitions(core_common_xdp_profile_objects + PRIVATE + XDP_VE2_BUILD=1 + ) + endif() + + diff --git a/src/runtime_src/xdp/CMakeLists.txt b/src/runtime_src/xdp/CMakeLists.txt index 63031cb72af..f42e4c58e72 100644 --- a/src/runtime_src/xdp/CMakeLists.txt +++ b/src/runtime_src/xdp/CMakeLists.txt @@ -8,7 +8,6 @@ # of the plugins and subdirectories. Also, set the install # locations for the plugins on Linux and Windows # ================================================================ - if (NOT WIN32) include_directories( @@ -29,13 +28,16 @@ else() endif() -if (XDP_CLIENT_BUILD_CMAKE STREQUAL "yes") - - add_compile_options("-DSKIP_IOCTL") +# Only include xdp in npu, alveo, or legacy xrt components +# For npu, set up different flags used conditionally in +# in subdirectories. +if (XRT_NPU) - add_subdirectory(profile) + set(XDP_CLIENT_BUILD_CMAKE "yes") + add_compile_options("-DSKIP_IOCTL") + add_subdirectory(profile) -else() +elseif(XRT_ALVEO) add_subdirectory(appdebug) add_subdirectory(debug)