Skip to content

Commit

Permalink
Add commands for coping missing dll files to the package on Windows, …
Browse files Browse the repository at this point in the history
…improve workflow for building wheels on macOS
  • Loading branch information
mwydmuch committed Aug 17, 2024
1 parent 6f93af1 commit d0ed738
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test-windows-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ jobs:
os: [windows-2022]
python-version: ['3.9', '3.10', '3.11', '3.12']
fail-fast: false

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

# Gather all dependencies
- name: Set up Python ${{ matrix.python-version }} environment
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
- name: Report OS
run: |
echo ${{ matrix.os }}
echo ${{ runner.os }}
uname -p
- name: Install dependencies on Ubuntu
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-14]
os: [ubuntu-22.04, macos-13, macos-14]

steps:
- uses: actions/checkout@v4
Expand All @@ -30,6 +30,7 @@ jobs:

- name: Report OS
run: |
echo ${{ matrix.os }}
echo ${{ runner.os }}
uname -p
Expand All @@ -39,16 +40,30 @@ jobs:
with:
platforms: all

- name: Build wheels
uses: pypa/[email protected]
- name: Build manylinux wheels
if: matrix.os == 'ubuntu-22.04'
uses: pypa/[email protected]
env:
# Configure cibuildwheel to build native archs, and some emulated ones
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BUILD_VERBOSITY: 3
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
auditwheel show {wheel} && auditwheel repair -w {dest_dir} {wheel}
- name: Build macOS Intel wheels
if: matrix.os == 'macos-13'
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64
CIBW_BUILD_VERBOSITY: 3

- name: Build macOS Apple Silicon wheels
if: matrix.os == 'macos-14'
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: arm64
CIBW_BUILD_VERBOSITY: 3

- name: Report built wheels
run: |
ls -l ./wheelhouse/*.whl
Expand Down
11 changes: 11 additions & 0 deletions src/lib_python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ add_custom_target(assemble_package ALL
COMMENT "Assembling Python package in ${VIZDOOM_PYTHON_OUTPUT_DIR}/vizdoom"
)

if(WIN32) # Copy DLLs for Windows
file(GLOB TXT_FILES "${VIZDOOM_OUTPUT_DIR}/*.dll")

foreach(file ${TXT_FILES})
add_custom_command(
TARGET assemble_package
COMMAND ${CMAKE_COMMAND} -E copy ${file} ${VIZDOOM_PYTHON_PACKAGE_DIR}
)
endforeach()
endif()

set_target_properties(assemble_package
PROPERTIES
PROJECT_LABEL "Python package")
Expand Down

0 comments on commit d0ed738

Please sign in to comment.