Skip to content

Commit

Permalink
Build on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jun 20, 2024
1 parent 9f590d0 commit 5f644a9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,20 @@ jobs:
python-version: ['3.10', '3.11', '3.12']
compiler: ['gcc', 'clang']
os: [macos, ubuntu]
include:
- python-version: '3.10'
compiler: microsoft
os: windows
- python-version: '3.11'
compiler: microsoft
os: windows
- python-version: '3.12'
compiler: microsoft
os: windows

runs-on: ${{ matrix.os }}-latest
env:
COMPILER: ${{ matrix.compiler }}
PYTHON_CMD: "python${{ matrix.python-version }}"

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -86,15 +95,20 @@ jobs:
python -m pip install --upgrade pip
pip install setuptools wheel
pip install -r python/requirements.txt
shell: bash

- name: build
run: CC=${COMPILER} ${PYTHON_CMD} setup.py build sdist
run: CC=${COMPILER} python setup.py build sdist
shell: bash

- name: install
run: pip install dist/[Gg]722*.gz
shell: bash

- name: test
run: ./scripts/do-test.sh "${PYTHON_CMD} test.py"
- if: ${{ matrix.os != 'windows' }}
name: test
run: ./scripts/do-test.sh "python test.py"
shell: bash

publish_wheels:
needs: build_and_test_python
Expand Down
13 changes: 9 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ def np_include():
import numpy as np
return f'-I{np.get_include()}'

compile_args = [f'-I{src_dir}', '-flto', np_include()]
smap_fname = f'{mod_dir}symbols.map'
link_args = ['-flto',]
if not get_platform().startswith('macosx-'):
is_win = get_platform().startswith('win')
is_mac = get_platform().startswith('macosx-')

compile_args = [f'-I{src_dir}', np_include()]
if not is_win:
compile_args.append('-flto')
link_args = ['-flto',] if not is_win else []
if not is_mac and not is_win:
smap_fname = f'{mod_dir}symbols.map'
link_args.append(f'-Wl,--version-script={smap_fname}')
debug_cflags = ['-g3', '-O0', '-DDEBUG_MOD']
debug_link_args = ['-g3', '-O0']
Expand Down

0 comments on commit 5f644a9

Please sign in to comment.