Skip to content

Commit

Permalink
[CI] build wheels macOS and Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tttapa committed Dec 2, 2024
1 parent 627f2d8 commit d55cc3d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ jobs:
# will use its default cross-compilation settings for Windows on ARM64.
# For macOS, we build universal wheels that work on both Intel and ARM macs.
build-macos-windows:
if: false
name: Build wheels for ${{ matrix.os }}
needs: [build-sdist]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions interfaces/python/src/inner/python-inner-solver.py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ void register_python_inner_solver(py::module_ &) {
return py::none();
}
};
static_assert(!std::uses_allocator_v<PythonInnerSolver, std::allocator<std::byte>>);
static_assert(std::is_constructible_v<PythonInnerSolver, py::object>);

assert(inner_solver_class<InnerSolver>.cls);
inner_solver_class<InnerSolver>.cls->def(py::init([](py::object solver) {
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ environment = { PY_BUILD_CMAKE_VERBOSE = "1" }
test-command = "pytest {package}/python/test"
test-extras = ["test"]

[tool.cibuildwheel.config-settings]
--local = "scripts/ci/py-build-cmake.toml"

[tool.cibuildwheel.macos]
archs = ["universal2"]
before-build = [
Expand Down
3 changes: 3 additions & 0 deletions scripts/ci/pre-build-macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
print(profile)

opts = dict(shell=True, check=True)
if not Path("recipes").exists():
run(f"git clone https://github.com/tttapa/conan-recipes recipes", **opts)
run(f"conan remote add tttapa-conan-recipes recipes --force", **opts)
for c in ("Debug", "Release"):
run(
"conan install . -pr:h ./cibw.profile --build=missing -s build_type=" + c,
Expand Down
3 changes: 3 additions & 0 deletions scripts/ci/pre-build-windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
print(profile)

opts = dict(shell=True, check=True)
if not Path("recipes").exists():
run(f"git clone https://github.com/tttapa/conan-recipes recipes", **opts)
run(f"conan remote add tttapa-conan-recipes recipes --force", **opts)
for c in ("RelWithDebInfo", "Release"):
run(
"conan install . -pr:h ./cibw.profile --build=missing -s build_type=Release",
Expand Down
2 changes: 2 additions & 0 deletions scripts/ci/py-build-cmake.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO = "/INCREMENTAL:NO /DEBUG:FULL /OPT:REF
ALPAQA_PYTHON_DEBUG_CONFIG = "RelWithDebInfo"
[windows.cmake.10]
install_config = "RelWithDebInfo"
preset = "conan-python-relwithdebinfo"
build_presets = "conan-python-relwithdebinfo"
build_path="build/python-relwithdebinfo"

0 comments on commit d55cc3d

Please sign in to comment.