Skip to content

Commit 5e8c441

Browse files
committed
Windows-compatible absolute paths
Signed-off-by: Julian Oppermann <[email protected]>
1 parent 69bb55f commit 5e8c441

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

sycl/test-e2e/KernelCompiler/kernel_compiler_sycl_jit_include_paths.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ auto constexpr IncludePathsSource = R"===(
2727
#include <sycl/sycl.hpp>
2828
2929
#ifdef USE_ABSOLUTE_INCLUDE
30+
31+
#ifndef _WIN32
3032
#include "/tmp/sycl-rtc-end-to-end-test/header1.hpp"
33+
#else
34+
#include "c:/tmp/sycl-rtc-end-to-end-test/header1.hpp"
35+
#endif
36+
3137
#else
3238
#include "header1.hpp"
3339
#include "B/header2.hpp"
@@ -147,7 +153,11 @@ int test_include_paths(const std::string &baseDir) {
147153

148154
// A bit silly, but including with an absolute path also works
149155
syclex::include_files absoluteVirtualIncludes{
156+
#ifndef _WIN32
150157
"/tmp/sycl-rtc-end-to-end-test/header1.hpp",
158+
#else
159+
"c:/tmp/sycl-rtc-end-to-end-test/header1.hpp",
160+
#endif
151161
"#define DEFINE_1 abs1\n#define DEFINE_2 abs2"};
152162
syclex::build_options setDefine{"-DUSE_ABSOLUTE_INCLUDE"};
153163
test_compilation(ctx, syclex::properties{absoluteVirtualIncludes},
@@ -162,7 +172,11 @@ int test_include_paths(const std::string &baseDir) {
162172
// situation in which the *same name* is used for the `#include` and the
163173
// `include_files` property, which is not the case here.
164174
syclex::build_options mixedIncludes;
175+
#ifndef _WIN32
165176
mixedIncludes.add("-I/tmp/sycl-rtc-end-to-end-test");
177+
#else
178+
mixedIncludes.add("-Ic:/tmp/sycl-rtc-end-to-end-test");
179+
#endif
166180
mixedIncludes.add("-I" + baseDir + "/include");
167181
test_compilation(ctx, syclex::properties{absoluteVirtualIncludes},
168182
syclex::properties{mixedIncludes});

0 commit comments

Comments
 (0)