Skip to content

Commit

Permalink
Add Windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lamyj committed Apr 15, 2024
1 parent 57b1040 commit 2549a10
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
10 changes: 8 additions & 2 deletions .ci/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
subprocess.check_call(
[
"cmake",
"-G", "Ninja",
# NOTE: if Ninja is used as a builder, compiler chain defaults to gcc on
# Windows
*(["-G", "Ninja"] if os.name != "nt" else []),
"-DPython_EXECUTABLE={}".format(sys.executable),
"-DCMAKE_INSTALL_PREFIX={}".format(install_dir),
*([os.environ["CMAKE_OPTIONS"]] if "CMAKE_OPTIONS" in os.environ else []),
workspace],
cwd=build_dir)

subprocess.check_call(["ninja", "install"], cwd=build_dir)
subprocess.check_call(
[
"cmake", "--build", ".", "--target", "install", "--config", "Release",
"--parallel"],
cwd=build_dir)
3 changes: 2 additions & 1 deletion .ci/build/conda.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
import subprocess
import sys

conda = sys.argv[1] if len(sys.argv) >= 2 else "conda"
conda = sys.argv[1] if len(sys.argv) >= 2 else os.environ.get("MAMBA_EXE", "conda")

subprocess.check_call([
conda, "install", "--yes", "-c", "conda-forge",
Expand Down
5 changes: 4 additions & 1 deletion .ci/build/post_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
# failed.
return_code = 0

# No extra environment needed for C++ part
# No extra environment needed for C++ part except for Windows
if os.name == "nt":
environment["PATH"] = os.pathsep.join([
*environment["PATH"].split(os.pathsep), lib_dir])
return_code = max(
return_code,
subprocess.call(
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- { os: "ubuntu-latest", container: "ubuntu:jammy", packaging: "apt", cmake_options: "-DCMAKE_CXX_STANDARD=17", python: "python3" }
- { os: "ubuntu-latest", packaging: "conda", cmake_options: "-DCMAKE_CXX_STANDARD=17", python: "python" }
- { os: "macos-latest", packaging: "conda", cmake_options: "-DCMAKE_CXX_STANDARD=17", python: "python" }
- { os: "windows-latest", packaging: "conda", cmake_options: "-DCMAKE_CXX_STANDARD=17", python: "python" }
env:
WORKSPACE: "${{ github.workspace }}"
CMAKE_OPTIONS: "${{ matrix.cmake_options }}"
Expand All @@ -35,7 +36,7 @@ jobs:
uses: mamba-org/setup-micromamba@v1
with:
init-shell: bash powershell
environment-name: dicomifier
environment-name: odil
create-args: python=3.11
if: ${{ contains(matrix.packaging, 'conda') }}

Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ add_library(libodil ${Source_Files} ${Header_Files} ${templates})
target_compile_definitions(
libodil
PUBLIC
BOOST_ASIO_SEPARATE_COMPILATION
ODIL_VERSION_MAJOR=${Odil_VERSION_MAJOR}
$<$<BOOL:BUILD_SHARED_LIBS>:BOOST_ALL_DYN_LINK>
$<$<PLATFORM_ID:Windows>:BOOST_UUID_FORCE_AUTO_LINK>
Expand Down
10 changes: 0 additions & 10 deletions src/odil/asio.cpp

This file was deleted.

1 change: 0 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ foreach(test_file ${tests})
target_compile_definitions(
test_${test}
PRIVATE
BOOST_ASIO_SEPARATE_COMPILATION
ODIL_VERSION_MAJOR=${Odil_VERSION_MAJOR}
$<$<BOOL:BUILD_SHARED_LIBS>:BOOST_ALL_DYN_LINK>)

Expand Down

0 comments on commit 2549a10

Please sign in to comment.