Skip to content

Commit

Permalink
Add support for building the library on Windows using MSVC. (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
junhaoliao authored Apr 16, 2024
1 parent 5d09598 commit d52c8b7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,20 @@ jobs:
- name: cp39-musllinux_x86_64
os: ubuntu-22.04

# Windows builds
- name: cp37-win_amd64
os: windows-2022
- name: cp38-win_amd64
os: windows-2022
- name: cp39-win_amd64
os: windows-2022
- name: cp310-win_amd64
os: windows-2022
- name: cp311-win_amd64
os: windows-2022
- name: cp312-win_amd64
os: windows-2022

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ python3 -m pip install --upgrade clp-ffi-py
Note:

- Python 3.7 or higher is required.
- Only Linux and macOS are supported at present.
- Tested on Linux, macOS and Windows.

To install an older version or download the prebuilt `whl` package, check the
project homepage on PyPI [here][16].
Expand All @@ -35,8 +35,10 @@ To manually build a package for distribution, follow the steps below.

### Requirements

* A C++ compiler that supports C++20 and `std::span` (e.g. `clang++` >= 7 or
`g++` >= 10).
* A C++ compiler that supports C++20 and `std::span`, e.g:
* `clang++` >= 7
* `g++` >= 10
* `MSVC` >= 1930 (included in Visual Studio 2022)
* python3
* python3-dev
* python3-venv
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ musllinux-x86_64-image = "musllinux_1_2"
skip = "pp*"

test-command = [
"cd {package}/tests",
"python -m unittest -fv",
"python -m unittest discover --failfast --verbose --start-directory={package}/tests"
]
test-requires = [
"smart_open==6.4.0"
Expand All @@ -68,6 +67,9 @@ archs = ["auto", "aarch64"]
[tool.cibuildwheel.macos]
archs = ["x86_64", "universal2", "arm64"]

[tool.cibuildwheel.windows]
archs = ["AMD64"]

[tool.docformatter]
make-summary-multi-line = true
pre-summary-newline = true
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
f"{clp_ffi_py_src_root}/utils.cpp",
],
extra_compile_args=[
"/std:c++20",
"/O2,"
] if "nt" == os.name else [
"-std=c++20",
"-O3",
],
Expand Down

0 comments on commit d52c8b7

Please sign in to comment.