Skip to content

Commit ecdd28f

Browse files
authored
Merge pull request #826 from kbenzie/benie/test-windows-clang-cl
[ur] Add support for clang-cl.exe on Windows
2 parents ee0a4b8 + 416b4ec commit ecdd28f

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.github/workflows/cmake.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ jobs:
9898
matrix:
9999
os: ['windows-2019', 'windows-2022']
100100
build_type: [Debug, Release]
101+
compiler: [{c: cl.exe, cxx: cl.exe}, {c: clang-cl.exe, cxx: clang-cl.exe}]
101102
runs-on: ${{matrix.os}}
102103

103104
steps:
@@ -114,6 +115,8 @@ jobs:
114115
run: >
115116
cmake
116117
-B${{github.workspace}}/build
118+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
119+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
117120
-DCMAKE_POLICY_DEFAULT_CMP0094=NEW
118121
-DUR_ENABLE_TRACING=ON
119122
-DUR_DEVELOPER_MODE=ON

cmake/helpers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function(add_ur_target_compile_options name)
7878
endif()
7979
elseif(MSVC)
8080
target_compile_options(${name} PRIVATE
81-
/MP
81+
$<$<CXX_COMPILER_ID:MSVC>:/MP> # clang-cl.exe does not support /MP
8282
/W3
8383
/MD$<$<CONFIG:Debug>:d>
8484
/GS

scripts/templates/params.hpp.mako

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ from templates import helper as th
3636
${x}_params::serializePtr(os, ${caller.body()});
3737
%elif th.type_traits.is_handle(itype):
3838
${x}_params::serializePtr(os, ${caller.body()});
39+
%elif iname and iname.startswith("pfn"):
40+
os << reinterpret_cast<void*>(${caller.body()});
3941
%else:
4042
os << ${caller.body()};
4143
%endif

source/common/ur_params.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11343,7 +11343,7 @@ operator<<(std::ostream &os,
1134311343
os << ", ";
1134411344
os << ".pfnDeleter = ";
1134511345

11346-
os << *(params->ppfnDeleter);
11346+
os << reinterpret_cast<void *>(*(params->ppfnDeleter));
1134711347

1134811348
os << ", ";
1134911349
os << ".pUserData = ";
@@ -12996,7 +12996,7 @@ operator<<(std::ostream &os,
1299612996
os << ", ";
1299712997
os << ".pfnNotify = ";
1299812998

12999-
os << *(params->ppfnNotify);
12999+
os << reinterpret_cast<void *>(*(params->ppfnNotify));
1300013000

1300113001
os << ", ";
1300213002
os << ".pUserData = ";

0 commit comments

Comments
 (0)