Skip to content

Commit d21bb39

Browse files
authored
[SYCL][E2E] Fix bindless images tests with windows cl (#18202)
These tests were failing on Windows when using a msvc-like compiler such as `clang-cl`, so this patch makes sure we're using the correct style of options depending on the compiler. Signed-off-by: Nicolas Miller <[email protected]>
1 parent 2c3e5ef commit d21bb39

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

sycl/test-e2e/bindless_images/dx12_interop/read_write_unsampled_semaphore.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
// XFAIL: run-mode
55
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/15851
66

7-
// RUN: %{build} -l d3d12 -l dxgi -l dxguid -o %t.out
7+
// DEFINE: %{link-flags}=%if cl_options %{ /clang:-ld3d12 /clang:-ldxgi /clang:-ldxguid %} %else %{ -ld3d12 -ldxgi -ldxguid %}
8+
// RUN: %{build} %{link-flags} -o %t.out
89
// RUN: %{run-unfiltered-devices} %t.out
910

1011
#define TEST_SEMAPHORE_IMPORT

sycl/test-e2e/lit.cfg.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -588,18 +588,16 @@ def open_check_file(file_name):
588588
config.substitutions.append(("%vulkan_include_dir", config.vulkan_include_dir))
589589
config.substitutions.append(("%vulkan_lib", config.vulkan_lib))
590590

591+
link_vulkan = "-I %s " % (config.vulkan_include_dir)
591592
if platform.system() == "Windows":
592-
config.substitutions.append(
593-
("%link-vulkan", "-l %s -I %s" % (config.vulkan_lib, config.vulkan_include_dir))
594-
)
593+
if cl_options:
594+
link_vulkan += "/clang:-l%s" % (config.vulkan_lib)
595+
else:
596+
link_vulkan += "-l %s" % (config.vulkan_lib)
595597
else:
596598
vulkan_lib_path = os.path.dirname(config.vulkan_lib)
597-
config.substitutions.append(
598-
(
599-
"%link-vulkan",
600-
"-L %s -lvulkan -I %s" % (vulkan_lib_path, config.vulkan_include_dir),
601-
)
602-
)
599+
link_vulkan += "-L %s -lvulkan" % (vulkan_lib_path)
600+
config.substitutions.append(("%link-vulkan", link_vulkan))
603601

604602
if config.vulkan_found == "TRUE":
605603
config.available_features.add("vulkan")

0 commit comments

Comments
 (0)