Skip to content

Commit 3f77fe0

Browse files
committed
Trying again to fix windows build
1 parent 066e995 commit 3f77fe0

3 files changed

Lines changed: 31 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,24 @@ jobs:
5757
chmod +x build.sh
5858
./build.sh
5959
60-
- name: Run build script (Windows)
60+
- name: Build on Windows
6161
if: matrix.os == 'windows-latest'
62-
shell: powershell
62+
shell: cmd
6363
run: |
64-
Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
65-
# amd64 is the correct enumerator name for 64-bit Intel/AMD
66-
Enter-VsDevShell -VsInstallPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" -Arch amd64
64+
:: 1. Load the Visual Studio tools
65+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
6766
68-
swift --version
67+
:: 2. Point to your specific DLL folder
68+
:: Note the backslashes for Windows pathing
69+
set "PATH=%GITHUB_WORKSPACE%\loop_to_python_api\dlibs\windows;%PATH%"
70+
71+
:: 3. Define the Swift SDK location
72+
set "SDKROOT=C:\Users\runneradmin\AppData\Local\Programs\Swift\Platforms\5.10.1\Windows.platform\Developer\SDKs\Windows.sdk"
73+
74+
:: 4. Verify we can see the DLLs (optional debug step)
75+
dir "%GITHUB_WORKSPACE%\loop_to_python_api\dlibs\windows"
76+
77+
:: 5. Run the build
6978
bash ./build.sh
7079
7180
- name: Verify library was built

loop_to_python_api/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import os
2+
import platform
3+
from pathlib import Path
4+
5+
if platform.system() == "Windows":
6+
# Get the path to your dlibs/windows folder relative to this file
7+
dll_dir = Path(__file__).parent / "dlibs" / "windows"
8+
9+
if dll_dir.exists():
10+
# This is the "Magic Sauce" for Windows Python
11+
os.add_dll_directory(str(dll_dir.resolve()))

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
url='https://github.com/miriamkw/LoopAlgorithmToPython',
1010
packages=find_packages(),
1111
package_data={
12-
'loop_to_python_api': ['libLoopAlgorithmToPython.dylib'],
12+
'loop_to_python_api': ['dlibs/macos/libLoopAlgorithmToPython.dylib',
13+
'dlibs/linux/libLoopAlgorithmToPython.so',
14+
'dlibs/windows/*.dll',
15+
'dlibs/windows/*.lib'
16+
],
1317
},
1418
include_package_data=True,
1519
install_requires=[

0 commit comments

Comments
 (0)