diff --git a/build/build.sh b/build/build.sh index eacfc213064..74d8cce552e 100755 --- a/build/build.sh +++ b/build/build.sh @@ -65,6 +65,7 @@ usage() echo "[-ccache] Build using RDI's compile cache" echo "[-toolchain ] Extra toolchain file to configure CMake" echo "[-driver] Include building driver code" + echo "[-xclbinutil] Build xclbinutil only" echo "[-checkpatch] Run checkpatch.pl on driver code" echo "[-verbose] Turn on verbosity when compiling" echo "[-ertbsp ] Path to directory with pre-downloaded BSP files for building ERT (default: download BSP files during build time)" @@ -207,6 +208,10 @@ while [ $# -gt 0 ]; do cmake_flags+=" -DXRT_PSKERNEL_BUILD=ON" shift ;; + -xclbinutil) + cmake_flags+=" -DXCLBINUTIL_ONLY_BUILD=ON" + shift + ;; -verbose) verbose="VERBOSE=1" shift diff --git a/src/CMake/findpackage.cmake b/src/CMake/findpackage.cmake index 3cdfb4f816b..dca18125623 100644 --- a/src/CMake/findpackage.cmake +++ b/src/CMake/findpackage.cmake @@ -44,18 +44,20 @@ install ( # This will generate a file that details all targets we have marked for export # as part of the xrt-targets export group # It will provide information such as the library file names and locations post install -if (NOT WIN32) -install( - EXPORT xrt-targets - NAMESPACE ${PROJECT_NAME}:: - DESTINATION ${XRT_INSTALL_DIR}/share/cmake/${PROJECT_NAME} - ) -endif() +if (NOT ${XCLBINUTIL_ONLY_BUILD}) + if (NOT WIN32) + install( + EXPORT xrt-targets + NAMESPACE ${PROJECT_NAME}:: + DESTINATION ${XRT_INSTALL_DIR}/share/cmake/${PROJECT_NAME} + ) + endif() -if (${XRT_NATIVE_BUILD} STREQUAL "yes") -install( - EXPORT xrt-dev-targets - NAMESPACE ${PROJECT_NAME}:: - DESTINATION ${XRT_INSTALL_DIR}/share/cmake/${PROJECT_NAME} - ) + if (NOT ${XRT_NATIVE_BUILD}) + install( + EXPORT xrt-dev-targets + NAMESPACE ${PROJECT_NAME}:: + DESTINATION ${XRT_INSTALL_DIR}/share/cmake/${PROJECT_NAME} + ) + endif() endif() diff --git a/src/CMake/nativeLnx.cmake b/src/CMake/nativeLnx.cmake index 8b4ec271249..7fa2abe4e6e 100644 --- a/src/CMake/nativeLnx.cmake +++ b/src/CMake/nativeLnx.cmake @@ -171,47 +171,48 @@ include (CMake/lint.cmake) xrt_add_subdirectory(runtime_src) -#XMA settings START -set(XMA_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") -set(XMA_INSTALL_DIR "${XRT_INSTALL_DIR}") -set(XMA_VERSION_STRING ${XRT_VERSION_MAJOR}.${XRT_VERSION_MINOR}.${XRT_VERSION_PATCH}) -set(XMA_SOVERSION ${XRT_SOVERSION}) -xrt_add_subdirectory(xma) -#XMA settings END - -# --- Python bindings --- -xrt_add_subdirectory(python) - -# --- Python tests --- -set(PY_TEST_SRC - ../tests/python/22_verify/22_verify.py - ../tests/python/utils_binding.py - ../tests/python/23_bandwidth/23_bandwidth.py - ../tests/python/23_bandwidth/host_mem_23_bandwidth.py - ../tests/python/23_bandwidth/versal_23_bandwidth.py) -install (FILES ${PY_TEST_SRC} - PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - DESTINATION ${XRT_INSTALL_DIR}/test) - -xrt_add_subdirectory("../tests/validate" "${CMAKE_CURRENT_BINARY_DIR}/validate_build") -message("-- XRT version: ${XRT_VERSION_STRING}") - +if(NOT ${XCLBINUTIL_ONLY_BUILD}) + #XMA settings START + set(XMA_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + set(XMA_INSTALL_DIR "${XRT_INSTALL_DIR}") + set(XMA_VERSION_STRING ${XRT_VERSION_MAJOR}.${XRT_VERSION_MINOR}.${XRT_VERSION_PATCH}) + set(XMA_SOVERSION ${XRT_SOVERSION}) + xrt_add_subdirectory(xma) + #XMA settings END + + # --- Python bindings --- + xrt_add_subdirectory(python) + + # --- Python tests --- + set(PY_TEST_SRC + ../tests/python/22_verify/22_verify.py + ../tests/python/utils_binding.py + ../tests/python/23_bandwidth/23_bandwidth.py + ../tests/python/23_bandwidth/host_mem_23_bandwidth.py + ../tests/python/23_bandwidth/versal_23_bandwidth.py) + install (FILES ${PY_TEST_SRC} + PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + DESTINATION ${XRT_INSTALL_DIR}/test) + xrt_add_subdirectory("../tests/validate" "${CMAKE_CURRENT_BINARY_DIR}/validate_build") + message("-- XRT version: ${XRT_VERSION_STRING}") +endif() # -- CPack include (CMake/cpackLin.cmake) +if(NOT ${XCLBINUTIL_ONLY_BUILD}) set (XRT_DKMS_DRIVER_SRC_BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/runtime_src/core") include (CMake/dkms.cmake) include (CMake/dkms-aws.cmake) include (CMake/dkms-azure.cmake) include (CMake/dkms-container.cmake) - # --- ICD --- include (CMake/icd.cmake) # --- Change Log --- include (CMake/changelog.cmake) +endif() # --- Package Config --- include (CMake/pkgconfig.cmake) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 262d7058fb7..c00bb4205f3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,9 @@ cmake_minimum_required(VERSION 3.5.0) project(XRT) set(PROJECT_DESCRIPTION "https://github.com/Xilinx/XRT") +option(XCLBINUTIL_ONLY_BUILD "Option to enable and disable build only xclbinutil" OFF) + + # Include utility functions include(CMake/utilities.cmake) @@ -126,7 +129,9 @@ if (${XRT_NATIVE_BUILD} STREQUAL "yes") else() include(CMake/nativeLnx.cmake) endif() + if (NOT ${XCLBINUTIL_ONLY_BUILD}) xrt_include(CMake/nativeTests.cmake) + endif() else() include(CMake/embedded_system.cmake) endif() diff --git a/src/runtime_src/CMakeLists.txt b/src/runtime_src/CMakeLists.txt index 47bf11a2d06..3122b6eba1f 100644 --- a/src/runtime_src/CMakeLists.txt +++ b/src/runtime_src/CMakeLists.txt @@ -6,7 +6,7 @@ if( NOT WIN32) -if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes") + if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes" AND NOT ${XCLBINUTIL_ONLY_BUILD}) xrt_add_subdirectory(doc) endif() @@ -30,12 +30,15 @@ endif(XRT_ENABLE_WERROR) if (${XRT_NATIVE_BUILD} STREQUAL "yes") add_compile_options( ${XRT_WARN_OPTS} ) endif() -xrt_add_subdirectory(xdp) +if (NOT ${XCLBINUTIL_ONLY_BUILD}) + xrt_add_subdirectory(xdp) + xrt_add_subdirectory(xocl) + xrt_add_subdirectory(xrt) + xrt_add_subdirectory(ert) +endif() xrt_add_subdirectory(tools/xclbinutil) -xrt_add_subdirectory(xocl) -xrt_add_subdirectory(xrt) -xrt_add_subdirectory(ert) + if (${XRT_NATIVE_BUILD} STREQUAL "yes") # Only for host native build. # For embedded, headers and libraries are installed in /usr @@ -47,7 +50,9 @@ endif() set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic") set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs") -xrt_add_subdirectory(core) +if (NOT ${XCLBINUTIL_ONLY_BUILD}) + xrt_add_subdirectory(core) +endif() else() # = WINDOWS ===================================================================