Skip to content

Commit 4dd642e

Browse files
committed
fix windows build action
1 parent e668efa commit 4dd642e

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515

1616
jobs:
1717
lint:
18-
name: Lint and Format
18+
name: Lint and Format
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout code
@@ -28,6 +28,12 @@ jobs:
2828
with:
2929
version: ${{ env.ZIG_VERSION }}
3030

31+
- name: Setup vcpkg (Windows)
32+
if: runner.os == 'Windows'
33+
uses: lukka/run-vcpkg@v11
34+
with:
35+
vcpkgGitCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6' # Latest stable
36+
3137
- name: Install system dependencies
3238
shell: bash
3339
run: |
@@ -53,7 +59,10 @@ jobs:
5359
echo "✅ macOS dependencies installed"
5460
;;
5561
Windows)
56-
choco install boost-msvc-14.3 cmake openssl
62+
# Install basic dependencies
63+
choco install cmake openssl
64+
# Install Boost via vcpkg for better CMake integration
65+
vcpkg install boost-system boost-filesystem boost-program-options --triplet x64-windows
5766
echo "✅ Windows dependencies installed"
5867
;;
5968
esac
@@ -106,6 +115,12 @@ jobs:
106115
with:
107116
version: ${{ matrix.zig-version }}
108117

118+
- name: Setup vcpkg (Windows)
119+
if: runner.os == 'Windows'
120+
uses: lukka/run-vcpkg@v11
121+
with:
122+
vcpkgGitCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6' # Latest stable
123+
109124
- name: Install system dependencies
110125
shell: bash
111126
run: |
@@ -131,7 +146,10 @@ jobs:
131146
echo "✅ macOS dependencies installed"
132147
;;
133148
Windows)
134-
choco install boost-msvc-14.3 cmake openssl
149+
# Install basic dependencies
150+
choco install cmake openssl
151+
# Install Boost via vcpkg for better CMake integration
152+
vcpkg install boost-system boost-filesystem boost-program-options --triplet x64-windows
135153
echo "✅ Windows dependencies installed"
136154
;;
137155
esac
@@ -293,6 +311,12 @@ jobs:
293311
with:
294312
version: ${{ env.ZIG_VERSION }}
295313

314+
- name: Setup vcpkg (Windows)
315+
if: runner.os == 'Windows'
316+
uses: lukka/run-vcpkg@v11
317+
with:
318+
vcpkgGitCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6' # Latest stable
319+
296320
- name: Install system dependencies
297321
shell: bash
298322
run: |
@@ -318,7 +342,10 @@ jobs:
318342
echo "✅ macOS dependencies installed"
319343
;;
320344
Windows)
321-
choco install boost-msvc-14.3 cmake openssl
345+
# Install basic dependencies
346+
choco install cmake openssl
347+
# Install Boost via vcpkg for better CMake integration
348+
vcpkg install boost-system boost-filesystem boost-program-options --triplet x64-windows
322349
echo "✅ Windows dependencies installed"
323350
;;
324351
esac

build.zig

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,19 @@ fn buildSolidityLibrariesImpl(step: *std.Build.Step, options: std.Build.Step.Mak
308308
try cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++");
309309
} else if (builtin.os.tag == .windows) {
310310
std.log.info("Adding Boost paths for Windows", .{});
311-
// Windows: Use MSVC by default, but ensure release mode
311+
// Windows: Use MSVC and configure Boost paths
312312
try cmake_args.append("-DCMAKE_CXX_FLAGS=/std:c++20");
313-
try cmake_args.append("-DBOOST_ROOT=C:/tools/boost");
313+
314+
// Try multiple possible Boost locations for Windows
315+
try cmake_args.append("-DCMAKE_PREFIX_PATH=C:/vcpkg/installed/x64-windows;C:/ProgramData/chocolatey/lib/boost-msvc-14.3/lib/native;C:/tools/boost");
316+
317+
// Set Boost-specific variables for older CMake compatibility
318+
try cmake_args.append("-DBoost_USE_STATIC_LIBS=ON");
319+
try cmake_args.append("-DBoost_USE_MULTITHREADED=ON");
320+
try cmake_args.append("-DBoost_USE_STATIC_RUNTIME=OFF");
321+
322+
// Suppress CMake developer warnings
323+
try cmake_args.append("-Wno-dev");
314324
}
315325

316326
// Configure CMake

0 commit comments

Comments
 (0)