Skip to content

Commit 5953058

Browse files
authored
Add ability to compile CppInterOp and tests on Windows with different compiler (#195)
1 parent e61e7ca commit 5953058

File tree

5 files changed

+70
-72
lines changed

5 files changed

+70
-72
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,14 @@ jobs:
162162
# cling-version: '1.0'
163163
# cppyy: On
164164
# xeus-clang-repl: On
165+
#FIXME: Windows CppInterOp tests expected to fail
166+
#until https://github.com/compiler-research/CppInterOp/issues/188 is solved
165167
- name: win2022-msvc-clang-repl-17
166168
os: windows-2022
167169
compiler: msvc
168170
clang-runtime: '17'
169171
cling: Off
170172
cppyy: Off
171-
#Commented out until rest of ci for Windows tested
172173
#- name: win2022-msvc-clang-repl-17-cppyy
173174
# os: windows-2022
174175
# compiler: msvc
@@ -181,7 +182,6 @@ jobs:
181182
clang-runtime: '16'
182183
cling: Off
183184
cppyy: Off
184-
#Commented out until rest of ci for Windows tested
185185
#- name: win2022-msvc-clang-repl-16-cppyy
186186
# os: windows-2022
187187
# compiler: msvc
@@ -195,14 +195,73 @@ jobs:
195195
cling: On
196196
cling-version: '1.0'
197197
cppyy: Off
198-
#Commented out until rest of ci for Windows tested
199198
#- name: win2022-msvc-cling-cppyy
200199
# os: windows-2022
201200
# compiler: msvc
202201
# clang-runtime: '13'
203202
# cling: On
204203
# cling-version: '1.0'
205204
# cppyy: On
205+
- name: osx14-arm-clang-clang-repl-17
206+
os: macos-14
207+
compiler: clang
208+
clang-runtime: '17'
209+
cling: Off
210+
cppyy: Off
211+
- name: osx14-arm-clang-clang-repl-17-cppyy
212+
os: macos-14
213+
compiler: clang
214+
clang-runtime: '17'
215+
cling: Off
216+
cppyy: On
217+
- name: osx14-arm-clang-clang-repl-17-xeus-clang-repl
218+
os: macos-14
219+
compiler: clang
220+
clang-runtime: '17'
221+
cling: Off
222+
cppyy: On
223+
xeus-clang-repl: On
224+
- name: osx14-arm-clang-clang-repl-16
225+
os: macos-14
226+
compiler: clang
227+
clang-runtime: '16'
228+
cling: Off
229+
cppyy: Off
230+
- name: osx14-arm-clang-clang-repl-16-cppyy
231+
os: macos-14
232+
compiler: clang
233+
clang-runtime: '16'
234+
cling: Off
235+
cppyy: On
236+
- name: osx14-arm-clang-clang-repl-16-xeus-clang-repl
237+
os: macos-14
238+
compiler: clang
239+
clang-runtime: '16'
240+
cling: Off
241+
cppyy: On
242+
xeus-clang-repl: On
243+
- name: osx14-arm-clang-clang13-cling
244+
os: macos-14
245+
compiler: clang
246+
clang-runtime: '13'
247+
cling: On
248+
cling-version: '1.0'
249+
cppyy: Off
250+
- name: osx14-arm-clang-clang13-cling-cppyy
251+
os: macos-14
252+
compiler: clang
253+
clang-runtime: '13'
254+
cling: On
255+
cling-version: '1.0'
256+
cppyy: On
257+
- name: osx14-arm-clang-clang13-cling-xeus-clang-repl
258+
os: macos-14
259+
compiler: clang
260+
clang-runtime: '13'
261+
cling: On
262+
cling-version: '1.0'
263+
cppyy: On
264+
xeus-clang-repl: On
206265
- name: osx13-x86-clang-clang-repl-17
207266
os: macos-13
208267
compiler: clang
@@ -263,69 +322,6 @@ jobs:
263322
cling-version: '1.0'
264323
cppyy: On
265324
xeus-clang-repl: On
266-
#Block commented out until free tier for m1
267-
#exists (expected sometime 2024) and key for os
268-
#can be replaced
269-
#- name: osx13-arm64-clang-clang-repl-17
270-
# os: macos-13-arm64
271-
# compiler: clang
272-
# clang-runtime: '17'
273-
# cling: Off
274-
# cppyy: Off
275-
#- name: osx13-arm64-clang-clang-repl-17-cppyy
276-
# os: macos-13-arm64
277-
# compiler: clang
278-
# clang-runtime: '17'
279-
# cling: Off
280-
# cppyy: On
281-
#- name: osx13-arm64-clang-clang-repl-17-xeus-clang-repl
282-
# os: macos-13-arm64
283-
# compiler: clang
284-
# clang-runtime: '17'
285-
# cling: Off
286-
# cppyy: On
287-
# xeus-clang-repl: On
288-
#- name: osx13-arm64-clang-clang-repl-16
289-
# os: macos-13-arm64
290-
# compiler: clang
291-
# clang-runtime: '16'
292-
# cling: Off
293-
# cppyy: Off
294-
#- name: osx13-arm64-clang-clang-repl-16-cppyy
295-
# os: macos-13-arm64
296-
# compiler: clang
297-
# clang-runtime: '16'
298-
# cling: Off
299-
# cppyy: On
300-
#- name: osx13-arm64-clang-clang-repl-16-xeus-clang-repl
301-
# os: macos-13-arm64
302-
# compiler: clang
303-
# clang-runtime: '16'
304-
# cling: Off
305-
# cppyy: On
306-
# xeus-clang-repl: On
307-
#- name: osx13-arm64-clang-clang13-cling
308-
# os: macos-13-arm64
309-
# compiler: clang
310-
# clang-runtime: '13'
311-
# cling: On
312-
# cling-version: '1.0'
313-
# cppyy: Off
314-
#- name: osx13-arm64-clang-clang13-cling-cppyy
315-
# os: macos-13-arm64
316-
# compiler: clang
317-
# clang-runtime: '13'
318-
# cling: On
319-
# cling-version: '1.0'
320-
# cppyy: On
321-
#- name: osx13-arm64-clang-clang13-cling-xeus-clang-repl
322-
# os: macos-13-arm64
323-
# compiler: clang
324-
# clang-runtime: '13'
325-
# cling: On
326-
# cling-version: '1.0'
327-
# cppyy: On
328-
# xeus-clang-repl: On
329325

330326
steps:
331327
- uses: actions/checkout@v3
@@ -362,7 +358,6 @@ jobs:
362358
- name: Save PR Info on Windows systems
363359
if: ${{ runner.os == 'windows' }}
364360
run: |
365-
#FIXME: CLING AND LLVM HASH currently hardcoded until windows equivalent of unix commands
366361
#can be found
367362
mkdir ./pr
368363
echo "${{ github.event.number }}" > ./pr/NR
@@ -710,8 +705,11 @@ jobs:
710705
echo "CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
711706
712707
- name: Build and Test/Install CppInterOp on Windows systems
708+
continue-on-error: true
713709
if: ${{ runner.os == 'windows' }}
714710
run: |
711+
#FIXME: Windows CppInterOp tests expected to fail
712+
#until https://github.com/compiler-research/CppInterOp/issues/188 is solved
715713
$env:PWD_DIR= $PWD.Path
716714
717715
$env:LLVM_DIR="$env:PWD_DIR\llvm-project"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ cmake --build . --target install --parallel $(nproc --all)
244244
```
245245
and
246246
```
247-
cmake -DUSE_CLING=Off -DUSE_REPL=ON -DLLVM_DIR=$LLVM_DIR\build\lib\cmake\llvm -DClang_DIR=$LLVM_DIR\build\lib\cmake\clang -DCMAKE_INSTALL_PREFIX=$env:CPPINTEROP_DIR ..
247+
cmake -DUSE_CLING=Off -DUSE_REPL=ON -DLLVM_DIR=$env:LLVM_DIR\build\lib\cmake\llvm -DClang_DIR=$env:LLVM_DIR\build\lib\cmake\clang -DCMAKE_INSTALL_PREFIX=$env:CPPINTEROP_DIR ..
248248
cmake --build . --target install --parallel $env:ncpus
249249
```
250250
on Windows. If alternatively you would like to install CppInterOp with Cling then execute the following commands on Linux and MacOS
@@ -254,7 +254,7 @@ cmake --build . --target install --parallel $(nproc --all)
254254
```
255255
and
256256
```
257-
cmake -DUSE_CLING=ON -DUSE_REPL=Off -DCling_DIR=$LLVM_DIR\build\tools\cling -DLLVM_DIR=$LLVM_DIR\build\lib\cmake\llvm -DClang_DIR=$LLVM_DIR\build\lib\cmake\clang -DCMAKE_INSTALL_PREFIX=$env:CPPINTEROP_DIR ..
257+
cmake -DUSE_CLING=ON -DUSE_REPL=Off -DCling_DIR=$env:LLVM_DIR\build\tools\cling -DLLVM_DIR=$env:LLVM_DIR\build\lib\cmake\llvm -DClang_DIR=$env:LLVM_DIR\build\lib\cmake\clang -DCMAKE_INSTALL_PREFIX=$env:CPPINTEROP_DIR ..
258258
cmake --build . --target install --parallel $env:ncpus
259259
```
260260

cmake/modules/GoogleTest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set(_gtest_byproducts
77
${_gtest_byproduct_binary_dir}/lib/libgmock_main.a
88
)
99

10-
if(MSVC)
10+
if(WIN32)
1111
set(EXTRA_GTEST_OPTS
1212
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=${_gtest_byproduct_binary_dir}/lib/
1313
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL:PATH=${_gtest_byproduct_binary_dir}/lib/

lib/Interpreter/CppInterOp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <string>
3535

3636
// Stream redirect.
37-
#ifdef WIN32
37+
#ifdef _WIN32
3838
#include <io.h>
3939
#ifndef STDOUT_FILENO
4040
#define STDOUT_FILENO 1

unittests/CppInterOp/TestSharedLib/TestSharedLib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define UNITTESTS_CPPINTEROP_TESTSHAREDLIB_TESTSHAREDLIB_H
33

44
// Avoid having to mangle/demangle the symbol name in tests
5-
#ifdef WIN32
5+
#ifdef _WIN32
66
extern "C" __declspec(dllexport) int ret_zero();
77
#else
88
extern "C" int ret_zero();

0 commit comments

Comments
 (0)