Skip to content

Commit

Permalink
Fix windows build errors
Browse files Browse the repository at this point in the history
Remove all xrt-dev-targets exports and consolidate install targets
to modern syntax.

Signed-off-by: Soren Soe <[email protected]>
  • Loading branch information
stsoe committed Jan 14, 2025
1 parent 4258d7e commit 2623482
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 91 deletions.
24 changes: 24 additions & 0 deletions build/build-win22.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ nocmake=0
noabi=0
dbg=0
release=1
alveo_build=0
npu_build=0
base_build=0
cmake_flags="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
while [ $# -gt 0 ]; do
case "$1" in
Expand Down Expand Up @@ -79,6 +82,22 @@ while [ $# -gt 0 ]; do
cmake_flags+= " -DXRT_ENABLE_HIP=ON"
shift
;;
-base)
shift
base_build=1
cmake_flags+= " -DXRT_BASE=1"
;;
-alveo)
shift
alveo_build=1
cmake_flags+=" -DXRT_ALVEO=1"
;;
-npu)
shift
npu_build=1
cmake_flags+=" -DXDP_CLIENT_BUILD_CMAKE=yes"
cmake_flags+=" -DXRT_NPU=1"
;;
-j)
shift
jcore=$1
Expand Down Expand Up @@ -116,6 +135,11 @@ cmake_flags+=" -DMSVC_PARALLEL_JOBS=$jcore"
cmake_flags+=" -DKHRONOS=$KHRONOS"
cmake_flags+=" -DBOOST_ROOT=$BOOST"

# Default build is legacy xrt, cannot be built with base, npu
if [[ $alveo_build == 0 && $npu_build == 0 && $base_build == 0 ]]; then
cmake_flags+=" -DXRT_XRT=1"
fi

echo "${cmake_flags[@]}"

if [ $dbg == 1 ]; then
Expand Down
2 changes: 1 addition & 1 deletion build/build22.bat
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ IF DEFINED MSVC_PARALLEL_JOBS ( SET LOCAL_MSVC_PARALLEL_JOBS=%MSVC_PARALLEL_JOBS

:argsParsed

set CMAKEFLAGS=%CMAKEFLAGS% -DMSVC_PARALLEL_JOBS=%LOCAL_MSVC_PARALLEL_JOBS% -DKHRONOS=%EXT_DIR% -DBOOST_ROOT=%EXT_DIR% -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
set CMAKEFLAGS=%CMAKEFLAGS% -DMSVC_PARALLEL_JOBS=%LOCAL_MSVC_PARALLEL_JOBS% -DKHRONOS=%EXT_DIR% -DBOOST_ROOT=%EXT_DIR% -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DXRT_XRT=1
ECHO CMAKEFLAGS=%CMAKEFLAGS%

if [%DEBUG%] == [1] (
Expand Down
3 changes: 0 additions & 3 deletions src/CMake/config/xrt-edge.fp.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ else()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/xrt-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/xrt-targets.cmake")
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/xrt-dev-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/xrt-dev-targets.cmake")
endif()
endif()

get_filename_component(@PROJECT_NAME@_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
Expand Down
3 changes: 0 additions & 3 deletions src/CMake/config/xrt.fp.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ else()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/xrt-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/xrt-targets.cmake")
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/xrt-dev-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/xrt-dev-targets.cmake")
endif()
endif()

get_filename_component(@PROJECT_NAME@_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
Expand Down
9 changes: 0 additions & 9 deletions src/CMake/findpackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,9 @@ 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 (${XRT_NATIVE_BUILD} STREQUAL "yes")
install(
EXPORT xrt-dev-targets
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${XRT_INSTALL_DIR}/share/cmake/${PROJECT_NAME}
)
endif()
11 changes: 3 additions & 8 deletions src/runtime_src/core/pcie/emulation/hw_emu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,10 @@ target_link_libraries(xrt_hwemu_static
uuid
)

install (TARGETS xrt_hwemu
EXPORT xrt-targets
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} ${XRT_NAMELINK_SKIP}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR}
)

install (TARGETS xrt_hwemu xrt_hwemu_static
EXPORT xrt-dev-targets
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT} ${XRT_NAMELINK_ONLY}
)

11 changes: 3 additions & 8 deletions src/runtime_src/core/pcie/emulation/sw_emu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,9 @@ target_link_libraries(xrt_swemu_static
uuid
)

install (TARGETS xrt_swemu
EXPORT xrt-targets
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} ${XRT_NAMELINK_SKIP}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR}
)

install (TARGETS xrt_swemu xrt_swemu_static
EXPORT xrt-dev-targets
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT} ${XRT_NAMELINK_ONLY}
)
11 changes: 3 additions & 8 deletions src/runtime_src/core/pcie/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,9 @@ target_link_libraries(xrt_core_static
pthread
)

install(TARGETS xrt_core
EXPORT xrt-targets
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} ${XRT_NAMELINK_SKIP}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR}
)

install(TARGETS xrt_core xrt_core_static
EXPORT xrt-dev-targets
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT} ${XRT_NAMELINK_ONLY}
)
9 changes: 2 additions & 7 deletions src/runtime_src/core/pcie/noop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ set_target_properties(xrt_noop PROPERTIES

install(TARGETS xrt_noop
EXPORT xrt-targets
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} ${XRT_NAMELINK_SKIP}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR}
)

install(TARGETS xrt_noop
EXPORT xrt-dev-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT} ${XRT_NAMELINK_ONLY}
)
11 changes: 3 additions & 8 deletions src/runtime_src/core/pcie/windows/alveo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,9 @@ endif()
# RUNTIME target and the corresponding import library is treated as an
# ARCHIVE target. All Windows-based systems including Cygwin are DLL
# platforms.
install(TARGETS xrt_core
EXPORT xrt-targets
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} ${XRT_NAMELINK_SKIP}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR}
)

install(TARGETS xrt_core xrt_core_static
EXPORT xrt-dev-targets
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT} ${XRT_NAMELINK_ONLY}
)
9 changes: 2 additions & 7 deletions src/runtime_src/core/tools/xbtracer/src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ endif()

install(TARGETS xrt_capture
EXPORT xrt-targets
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} ${XRT_NAMELINK_SKIP}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR}
)

install(TARGETS xrt_capture
EXPORT xrt-dev-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT} ${XRT_NAMELINK_ONLY}
)
9 changes: 2 additions & 7 deletions src/runtime_src/hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,9 @@ set_target_properties(xrt_hip PROPERTIES

install(TARGETS xrt_hip
EXPORT xrt-targets
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} ${XRT_NAMELINK_SKIP}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR}
)

install(TARGETS xrt_hip
EXPORT xrt-dev-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT} ${XRT_NAMELINK_ONLY}
)

# Release headers
Expand Down
17 changes: 3 additions & 14 deletions src/runtime_src/xocl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,11 @@ target_link_libraries(xilinxopencl

endif ()

# install(TARGETS xilinxopencl
# ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
# LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT xrt NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
# RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR}
# )

install(TARGETS xilinxopencl
EXPORT xrt-targets
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} ${XRT_NAMELINK_SKIP}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR}
)

install(TARGETS xilinxopencl xilinxopencl_static
EXPORT xrt-dev-targets
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT} ${XRT_NAMELINK_ONLY}
)

# Release OpenCL extension headers
Expand Down
11 changes: 3 additions & 8 deletions src/runtime_src/xrt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,9 @@ target_link_libraries(xrt++
set_target_properties(xrt++ PROPERTIES VERSION ${XRT_VERSION_STRING}
SOVERSION ${XRT_SOVERSION})

install(TARGETS xrt++
EXPORT xrt-targets
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} ${XRT_NAMELINK_SKIP}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR}
)

install(TARGETS xrt++ xrt++_static
EXPORT xrt-dev-targets
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT} ${XRT_NAMELINK_ONLY}
)

0 comments on commit 2623482

Please sign in to comment.