Skip to content

Commit 5b5376b

Browse files
erwei-xilinxclaude
andauthored
Build test_utils on Windows to fix missing lib/ in wheel (#3024)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 87fb4fc commit 5b5376b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

runtime_lib/test_lib/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
cmake_minimum_required(VERSION 3.30)
88
project("test lib for ${AIE_RUNTIME_TARGET}")
99

10+
set(CMAKE_CXX_STANDARD 17)
11+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
12+
1013
function(add_runtime_pic_flag target_name)
1114
if (NOT WIN32)
1215
target_compile_options(${target_name} PRIVATE -fPIC)
@@ -28,7 +31,6 @@ if ("${AIE_RUNTIME_TARGET}" STREQUAL "x86_64-hsa")
2831
endif()
2932
if (WIN32)
3033
set(BUILD_TEST_LIBRARY OFF)
31-
set(BUILD_TEST_UTILS_LIBRARY OFF)
3234
endif()
3335

3436
# test_lib library
@@ -66,7 +68,10 @@ if (BUILD_TEST_UTILS_LIBRARY)
6668
set_target_properties(test_utils PROPERTIES PUBLIC_HEADER "test_utils.h;xrt_test_wrapper.h;cxxopts.hpp")
6769
add_runtime_pic_flag(test_utils)
6870

69-
if (${XRT_FOUND})
71+
# XRT headers on Windows pull in boost/any.hpp which is not typically
72+
# available. Skip XRT integration there; the core helpers (load_instr_*,
73+
# nearly_equal, etc.) are still usable without it.
74+
if (${XRT_FOUND} AND NOT WIN32)
7075
target_compile_options(test_utils PRIVATE -DTEST_UTILS_USE_XRT)
7176
target_include_directories(test_utils PRIVATE ${XRT_INCLUDE_DIR})
7277
endif()

0 commit comments

Comments
 (0)