diff --git a/build/build.sh b/build/build.sh index fa073c620e7..060a2330b99 100755 --- a/build/build.sh +++ b/build/build.sh @@ -209,7 +209,7 @@ while [ $# -gt 0 ]; do shift ;; -xclbinutil) - cmake_flags+=" -DBUILD_TARGET=xclbinutil" + cmake_flags+=" -DXRT_ONLY_XCLBINUTIL=ON" shift ;; -verbose) diff --git a/src/CMake/findpackage.cmake b/src/CMake/findpackage.cmake index a9c1c928f6e..4cbb21f48af 100644 --- a/src/CMake/findpackage.cmake +++ b/src/CMake/findpackage.cmake @@ -44,7 +44,7 @@ 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 BUILD_TARGET) +if (NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") if (NOT WIN32) install( EXPORT xrt-targets diff --git a/src/CMake/nativeLnx.cmake b/src/CMake/nativeLnx.cmake index 3790ce7256f..769edf1b3be 100644 --- a/src/CMake/nativeLnx.cmake +++ b/src/CMake/nativeLnx.cmake @@ -170,7 +170,8 @@ message("-- Compiler: ${CMAKE_CXX_COMPILER} ${CMAKE_C_COMPILER}") include (CMake/lint.cmake) xrt_add_subdirectory(runtime_src) -if (NOT BUILD_TARGET) + +if(NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") #XMA settings START set(XMA_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(XMA_INSTALL_DIR "${XRT_INSTALL_DIR}") @@ -192,31 +193,31 @@ if (NOT BUILD_TARGET) 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 ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") 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) # --- Coverity Support --- include (CMake/coverity.cmake) -endif() + # --- Find Package Support --- include (CMake/findpackage.cmake) set (CTAGS "${XRT_SOURCE_DIR}/runtime_src/tools/scripts/tags.sh") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 517d55142cc..6b8be8eb541 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.5.0) project(XRT) set(PROJECT_DESCRIPTION "https://github.com/Xilinx/XRT") +option(XRT_ONLY_XCLBINUTIL "Option to enable and disabel build only xclbinutil" OFF) + # Include utility functions include(CMake/utilities.cmake) @@ -27,10 +29,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) message("-- Host system processor is ${CMAKE_HOST_SYSTEM_PROCESSOR}") message("-- Target system processor is ${CMAKE_SYSTEM_PROCESSOR}") -if(DEFINED BUILD_TARGET AND NOT ${BUILD_TARGET} STREQUAL "xclbinutil") - message(FATAL_ERROR "Build target should be set to xclbinutil") -endif() - set(XRT_NATIVE_BUILD "yes") if (NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}) set(XRT_NATIVE_BUILD "no") @@ -76,7 +74,6 @@ set (CMAKE_INSTALL_PREFIX "/opt/xilinx") if (${XRT_NATIVE_BUILD} STREQUAL "no") set (CMAKE_INSTALL_PREFIX "/usr") endif() - # Enable AIE even on x86. This is POC, once # complete we will remove the need for these # macros and defines. @@ -129,7 +126,7 @@ if (${XRT_NATIVE_BUILD} STREQUAL "yes") else() include(CMake/nativeLnx.cmake) endif() - if (NOT BUILD_TARGET) + if (NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") xrt_include(CMake/nativeTests.cmake) endif() else() diff --git a/src/runtime_src/CMakeLists.txt b/src/runtime_src/CMakeLists.txt index 3e632a7e052..e5916c9c8c1 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 ${XRT_ONLY_XCLBINUTIL} STREQUAL "yes") xrt_add_subdirectory(doc) endif() @@ -30,7 +30,7 @@ endif(XRT_ENABLE_WERROR) if (${XRT_NATIVE_BUILD} STREQUAL "yes") add_compile_options( ${XRT_WARN_OPTS} ) endif() -if (NOT BUILD_TARGET) +if (NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") xrt_add_subdirectory(xdp) xrt_add_subdirectory(xocl) xrt_add_subdirectory(xrt) @@ -50,7 +50,7 @@ endif() set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic") set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs") -if (NOT BUILD_TARGET) +if (NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") xrt_add_subdirectory(core) endif()