Skip to content

Commit 60b7254

Browse files
committed
windows build fix
1 parent a9fde2c commit 60b7254

1 file changed

Lines changed: 20 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,28 @@ jobs:
6161
if: matrix.os == 'windows-latest'
6262
shell: cmd
6363
run: |
64-
:: 1. Initialize Visual Studio Environment
64+
:: 1. Initialize Visual Studio
6565
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
6666
67-
:: 2. Set the SDK Root
68-
set "SDKROOT=C:\Users\runneradmin\AppData\Local\Programs\Swift\Platforms\6.0.3\Windows.platform\Developer\SDKs\Windows.sdk"
69-
70-
:: 3. Fix Cyclic Dependency
71-
:: We tell the C compiler (Clang) to ignore the standard module cache and
72-
:: force it to prioritize the Swift-specific module maps.
73-
set "SWIFTFLAGS=-sdk %SDKROOT% -I %SDKROOT%\usr\lib\swift -L %SDKROOT%\usr\lib\swift\windows"
74-
75-
echo Starting Fresh Swift Build...
76-
:: We add -Xcc -fno-implicit-modules to break the cycle during the build
77-
swift build -c release -v -Xcc -fno-implicit-modules -Xcc -fno-modules
78-
79-
if %ERRORLEVEL% NEQ 0 (
80-
echo "Swift build failed with exit code %ERRORLEVEL%"
81-
exit /b %ERRORLEVEL%
82-
)
83-
84-
echo Build finished.
67+
:: 2. Set Paths
68+
set "SWIFT_ROOT=C:\Users\runneradmin\AppData\Local\Programs\Swift"
69+
set "SDKROOT=%SWIFT_ROOT%\Platforms\6.0.3\Windows.platform\Developer\SDKs\Windows.sdk"
70+
:: This is the missing piece:
71+
set "RESOURCE_DIR=%SWIFT_ROOT%\Toolchains\6.0.3+Asserts\usr\lib\swift"
72+
73+
echo Starting Build with Resource Dir Fix...
74+
:: We pass the resource-dir and explicitly include the shims path
75+
swift build -c release -v ^
76+
-Xswiftc -resource-dir -Xswiftc "%RESOURCE_DIR%" ^
77+
-Xswiftc -I -Xswiftc "%RESOURCE_DIR%\shims" ^
78+
-Xcc -fno-implicit-modules ^
79+
-Xcc -fno-modules ^
80+
-Xcc -D_CRT_USE_BUILTIN_OFF ^
81+
-Xswiftc -Xfrontend -Xswiftc -disable-implicit-concurrency-module-import
82+
83+
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
84+
85+
echo Build successful!
8586
dir /s /b .build\*.dll
8687
8788
- name: Verify library was built

0 commit comments

Comments
 (0)