Skip to content

Commit e985089

Browse files
authored
Add Windows pipeline (#127)
* Add Windows pipeline
1 parent 1090ae8 commit e985089

File tree

23 files changed

+267
-30
lines changed

23 files changed

+267
-30
lines changed

.azure-pipelines.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,18 @@ jobs:
1414
maxParallel: 2
1515
steps:
1616
- template: ./.ci/macos.yml
17+
18+
- job: 'Windows_64'
19+
pool:
20+
vmImage: 'windows-latest'
21+
strategy:
22+
matrix:
23+
Python38:
24+
python.version: '3.8'
25+
Python37:
26+
python.version: '3.7'
27+
Python36:
28+
python.version: '3.6'
29+
maxParallel: 2
30+
steps:
31+
- template: ./.ci/windows.yml

.ci/windows.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
steps:
2+
- task: UsePythonVersion@0
3+
inputs:
4+
versionSpec: '$(python.version)'
5+
displayName: "Using Python version: $(python.version)"
6+
7+
- script: |
8+
python -m pip install --upgrade pip pytest numpy
9+
displayName: 'Pip install Python dependencies'
10+
11+
- script: |
12+
cmake -H. -Bbuild ^
13+
-A x64 ^
14+
-DCMAKE_BUILD_TYPE=Release ^
15+
-DCMAKE_INSTALL_PREFIX=$(Agent.BuildDirectory)\Software\xcfun ^
16+
-DCMAKE_CXX_COMPILER=cl.exe ^
17+
-DXCFUN_PYTHON_INTERFACE=ON
18+
displayName: "Configure XCFun"
19+
20+
- script: |
21+
cmake --build build ^
22+
--config Release ^
23+
--target install
24+
displayName: "Build XCFun"
25+
26+
- script: |
27+
cd build
28+
ctest --output-on-failure ^
29+
-C Release ^
30+
-E python-interface ^
31+
--verbose
32+
displayName: "Test XCFun with CTest"
33+
34+
# Test we can build the C++ example
35+
- script: |
36+
cmake -H.\examples\CXX_host -Bbuild_CXX_host ^
37+
-A x64 ^
38+
-DCMAKE_BUILD_TYPE=Release ^
39+
-DXCFun_DIR=$(Agent.BuildDirectory)\Software\xcfun\share\cmake\XCFun ^
40+
-DCMAKE_CXX_COMPILER=cl.exe
41+
displayName: "Configure C++ host examples"
42+
43+
- script: |
44+
cmake --build build_CXX_host
45+
displayName: "Build C++ host example"
46+
47+
# Test we can build the C example
48+
- script: |
49+
cmake -H.\examples\C_host -Bbuild_C_host ^
50+
-A x64 ^
51+
-DCMAKE_BUILD_TYPE=Release ^
52+
-DXCFun_DIR=$(Agent.BuildDirectory)\Software\xcfun\share\cmake\XCFun ^
53+
-DCMAKE_C_COMPILER=cl.exe
54+
displayName: "Configure C host examples"
55+
56+
- script: |
57+
cmake --build build_C_host
58+
displayName: "Build C host example"
59+
60+
# - script: |
61+
# set PYTHONPATH=$(Agent.BuildDirectory)\Software\xcfun\lib\python;%PYTHONPATH%
62+
# ls $(Agent.BuildDirectory)\Software\xcfun\lib\python\xcfun
63+
# python -c "import xcfun; print(xcfun.xcfun_splash())"
64+
# displayName: "Test XCFun Python module"

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ matrix:
7171

7272
env:
7373
global:
74-
- CMAKE_VERSION="3.11.4"
74+
- CMAKE_VERSION="3.14.7"
7575

7676
before_install:
7777
- test -n $CC && unset CC

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
### Added
4+
5+
- The library can now be _natively_ compiled on Linux, macOS, and Windows.
6+
7+
### Changed
8+
9+
- **BREAKING** CMake >= 3.14 is required to configure the code.
10+
311
## [Version 2.0.2] - 2020-07-15
412

513
### Fixed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2015-2020 by Radovan Bast, Roberto Di Remigio, Jonas Juselius, and contributors.
33

44
# set minimum cmake version
5-
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
5+
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
66

77
# project name
88
project(XCFun LANGUAGES CXX)

cmake/autocmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# adapt the following lines and expand
44

55
name: XCFun
6-
min_cmake_version: 3.11
6+
min_cmake_version: 3.14
77
setup_script: setup
88
url_root: https://github.com/coderefinery/autocmake/raw/master/
99
default_build_type: Debug

cmake/custom/xcfun.cmake

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@ set(PROJECT_VERSION_MAJOR 2)
2828
set(PROJECT_VERSION_MINOR 0)
2929
set(PROJECT_VERSION_PATCH 2)
3030

31-
if(WIN32 AND NOT CYGWIN)
32-
set(DEF_INSTALL_CMAKEDIR CMake)
33-
else()
34-
set(DEF_INSTALL_CMAKEDIR share/cmake/${PROJECT_NAME})
35-
endif()
36-
set(CMAKECONFIG_INSTALL_DIR ${DEF_INSTALL_CMAKEDIR} CACHE PATH "Installation directory for CMake files")
31+
set(CMAKECONFIG_INSTALL_DIR share/cmake/${PROJECT_NAME} CACHE PATH "Installation directory for CMake files")
3732

3833
add_subdirectory(${PROJECT_SOURCE_DIR}/api)
3934
add_subdirectory(${PROJECT_SOURCE_DIR}/src)

examples/CXX_host/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.11)
1+
cmake_minimum_required(VERSION 3.14)
22

33
project(CXX_host LANGUAGES CXX)
44

examples/C_host/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.11)
1+
cmake_minimum_required(VERSION 3.14)
22

33
project(C_host LANGUAGES C)
44

examples/Fortran_host/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.11)
1+
cmake_minimum_required(VERSION 3.14)
22

33
project(Fortran_host LANGUAGES Fortran)
44

0 commit comments

Comments
 (0)