(re)enable windows build
turning it off and on again seems to work here too ;)
This commit is contained in:
parent
7bdec4a62f
commit
01e7b84d89
6 changed files with 74 additions and 12 deletions
10
.github/workflows/build.yaml
vendored
10
.github/workflows/build.yaml
vendored
|
|
@ -78,13 +78,13 @@ jobs:
|
|||
needs:
|
||||
- changes
|
||||
- timestamp
|
||||
if: ${{ needs.changes.outputs.pygomx == 'needsbuildfix' }}
|
||||
if: ${{ needs.changes.outputs.pygomx == 'true' }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-2022, windows-11-arm]
|
||||
os: [windows-2022]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
|
@ -101,7 +101,9 @@ jobs:
|
|||
package-dir: pygomx
|
||||
env:
|
||||
SOURCE_DATE_EPOCH: ${{ needs.timestamp.outputs.sepoch }}
|
||||
CIBW_SKIP: "*-win32"
|
||||
CIBW_SKIP: "*-win32 *t-*"
|
||||
PYGOMX_BUILD_MODE: shared
|
||||
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path ${{ github.workspace }}\\pygomx -w {dest_dir} {wheel}"
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
|
|
@ -153,7 +155,7 @@ jobs:
|
|||
- changes
|
||||
- pygomx-wheel-mac
|
||||
- pygomx-wheel-linux
|
||||
#- pygomx-wheel-win
|
||||
- pygomx-wheel-win
|
||||
if: ${{ needs.changes.outputs.pygomx == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
|
|
|
|||
2
pygomx/.gitignore
vendored
2
pygomx/.gitignore
vendored
|
|
@ -8,3 +8,5 @@ build/
|
|||
*.a
|
||||
__pycache__
|
||||
.eggs/
|
||||
libmxclient.*
|
||||
!libmxclient.def
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ import os
|
|||
|
||||
from cffi import FFI
|
||||
|
||||
if os.name == "nt":
|
||||
lib_list = [
|
||||
"libmxclient",
|
||||
]
|
||||
else:
|
||||
lib_list = [
|
||||
"mxclient",
|
||||
]
|
||||
|
|
|
|||
29
pygomx/libmxclient.def
Normal file
29
pygomx/libmxclient.def
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
EXPORTS
|
||||
FreeCString
|
||||
apiv0_createclient
|
||||
apiv0_createclient_pass
|
||||
apiv0_createroom
|
||||
apiv0_deinitialize
|
||||
apiv0_discover
|
||||
apiv0_getoptions
|
||||
apiv0_initialize
|
||||
apiv0_joinedrooms
|
||||
apiv0_leaveroom
|
||||
apiv0_listclients
|
||||
apiv0_login
|
||||
apiv0_removeclient
|
||||
apiv0_sendmessage
|
||||
apiv0_set_on_event_handler
|
||||
apiv0_set_on_message_handler
|
||||
apiv0_set_on_sys_handler
|
||||
apiv0_setoptions
|
||||
apiv0_startclient
|
||||
apiv0_stopclient
|
||||
cliv0_accountinfo
|
||||
cliv0_clearaccount
|
||||
cliv0_discoverhs
|
||||
cliv0_genericrequest
|
||||
cliv0_mkmxtoken
|
||||
cliv0_mxpassitem
|
||||
cliv0_serverinfo
|
||||
cliv0_whoami
|
||||
|
|
@ -18,3 +18,8 @@ heimseite = "https://code.c-base.org/saces/pygomx"
|
|||
|
||||
[tool.setuptools.package-dir]
|
||||
"pygomx" = "src/pygomx"
|
||||
|
||||
# Use delvewheel on windows
|
||||
[tool.cibuildwheel.windows]
|
||||
before-build = "pip install delvewheel"
|
||||
repair-wheel-command = "delvewheel repair --add-path . -w {dest_dir} {wheel}"
|
||||
|
|
|
|||
|
|
@ -43,9 +43,15 @@ class CustomCommand(Command):
|
|||
match os.getenv("PYGOMX_BUILD_MODE", "static"):
|
||||
case "static":
|
||||
build_mode_name = "c-archive"
|
||||
if os.name == "nt":
|
||||
build_mode_ext = ".lib"
|
||||
else:
|
||||
build_mode_ext = ".a"
|
||||
case "shared":
|
||||
build_mode_name = "c-shared"
|
||||
if os.name == "nt":
|
||||
build_mode_ext = ".dll"
|
||||
else:
|
||||
build_mode_ext = ".so"
|
||||
case _:
|
||||
raise ValueError("Invalid PYGOMX_BUILD_MODE.")
|
||||
|
|
@ -73,9 +79,22 @@ class CustomCommand(Command):
|
|||
f"../pygomx/libmxclient{build_mode_ext}",
|
||||
".",
|
||||
]
|
||||
ret = subprocess.call(go_call, cwd="../libmxclient")
|
||||
if ret != 0:
|
||||
raise Exception("Go build failed.")
|
||||
# print(f"DEBUG: {' '.join(go_call) }")
|
||||
subprocess.check_call(go_call, cwd="../libmxclient")
|
||||
|
||||
if os.name == "nt" and os.getenv("PYGOMX_BUILD_MODE", "nope") == "shared":
|
||||
from setuptools._distutils.compilers.C.msvc import Compiler
|
||||
|
||||
comp = Compiler()
|
||||
comp.initialize()
|
||||
subprocess.check_call(
|
||||
[
|
||||
comp.lib,
|
||||
"/def:libmxclient.def",
|
||||
"/machine:AMD64",
|
||||
"/out:libmxclient.lib",
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
class CustomBuild(build):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue