Skip to content

Commit 7b2ef45

Browse files
committed
Add win32 draft
1 parent 4d1f19e commit 7b2ef45

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

.github/workflows/wheels.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,27 @@ jobs:
5555
run: |
5656
${{ env.VCPKG_ROOT }}/vcpkg install --triplet=x64-windows-static
5757
58-
- name: Build extension
58+
- name: Last build environment setup setps
5959
run: |
6060
call .venv\Scripts\activate.bat
6161
python automations/my_automator.py setup dev-env
6262
cibuildwheel .
6363
shell: cmd
6464

65+
- name: Build Win32 C extension
66+
run: |
67+
call .venv\Scripts\activate.bat
68+
set WIN_ARCH='x86'
69+
cibuildwheel . --platform windows --archs x86
70+
shell: cmd
71+
72+
- name: Build Win64 C extension
73+
run: |
74+
call .venv\Scripts\activate.bat
75+
set WIN_ARCH='x64'
76+
cibuildwheel . --platform windows --archs AMD64
77+
shell: cmd
78+
6579
- name: Upload artifact
6680
uses: actions/upload-artifact@v4
6781
with:
@@ -174,6 +188,7 @@ jobs:
174188
run: |
175189
source .venv/bin/activate
176190
python automations/my_automator.py setup dev-env
191+
export CIBW_BEFORE_ALL="yum install -y perl perl-IPC-Cmd"
177192
cibuildwheel .
178193
179194
- name: Upload artifact

CMakeLists.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@ if(WIN32)
1414
set(PLATFORM WINDOWS)
1515
# The vcpkg target triplet has to be set BEFORE the project() function
1616
# of CMake!
17-
set(VCPKG_TARGET_TRIPLET x64-windows-static)
17+
if(DEFINED ENV{WIN_ARCH})
18+
# The cibuildwheel tool builds wheel files for both 32- and 64-Bit
19+
# Windows, therefore the vcpkg target triplet needs to be switched
20+
# accordingly.
21+
if($ENV{WIN_ARCH} STREQUAL "x86")
22+
set(VCPKG_TARGET_TRIPLET x86-windows-static)
23+
elseif($ENV{WIN_ARCH} STREQUAL "x64")
24+
set(VCPKG_TARGET_TRIPLET x64-windows-static)
25+
endif()
26+
else()
27+
message(FATAL_ERROR "WIN_ARCH environment variable is not defined")
28+
endif()
1829
elseif(APPLE)
1930
# On macOS it is necessary to set an environment variable called ARCH with the
2031
# arch (either x86_64 or arm64) of your Mac
@@ -47,7 +58,7 @@ if (${PLATFORM} STREQUAL "WINDOWS")
4758
set_target_properties(opengl32 PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/pre-built/windows/libx64/OpenGL32.Lib)
4859

4960
set(LIB_DIR
50-
${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows-static/lib
61+
${CMAKE_SOURCE_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}-windows-static/lib
5162
${CMAKE_SOURCE_DIR}/pre-built/windows/libx64
5263
)
5364
set(ALL_COMPILER_ARGS
@@ -56,7 +67,7 @@ if (${PLATFORM} STREQUAL "WINDOWS")
5667
/std:c++17
5768
)
5869
set (OS_SPECIFIC_INCLUDES
59-
vcpkg_installed/x64-windows-static/include
70+
vcpkg_installed/${VCPKG_TARGET_TRIPLET}-windows-static/include
6071
)
6172
set (OS_SPECIFIC_LIBRARY_NAMES
6273
Advapi32 Ws2_32 glew32 freetype libpng16 libxml2 opengl32 netCDF::netcdf

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ pymol2 = "modules/pymol2"
6767
build = ["cp310-*", "cp311-*", "cp312-*"]
6868
# build = ["cp311-*"] # Only for debug purposes
6969
# Skip 32-bit builds
70-
skip = ["*-win32", "*-manylinux_i686"]
70+
#skip = ["*-win32", "*-manylinux_i686"]
71+
skip = ["*-manylinux_i686"]
7172
test-requires = ["pytest", "importlib_metadata"]
7273
test-command = "pytest {project}/tests/"
7374

0 commit comments

Comments
 (0)