File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,9 +35,14 @@ if [ "$HOST_OS" = "Linux" ] && [ "$(uname -m)" = "aarch64" ]; then
3535fi
3636
3737if [ " $HOST_OS " = " Windows" ]; then
38- ARGS+=(" -G" " Ninja" )
38+ ARGS+=(" -G" " Ninja" " -DCMAKE_TOOLCHAIN_FILE= $PWD /../.github/scripts/windows-ghc-toolchain.cmake " )
3939 sed -i ' s/find_library(GMP_LIBRARY gmp)/find_library(GMP_LIBRARY NAMES libgmp.a)/' CMakeLists.txt
4040
41+ # This ends up causing the system headers to be included with -I and
42+ # thus they override the GHC mingw compiler ones. So this removes it
43+ # and re-adds the include with idirafter via the toolchain file
44+ sed -i ' /INCLUDE_DIRECTORIES.*OPENSSL_INCLUDE_DIR/d' CMakeLists.txt
45+
4146 # Apply windows-specific libff patch carried by hevm
4247 curl -fsSL https://raw.githubusercontent.com/ethereum/hevm/1abe4c79eeada928acc279b631c48eeb2a1376c2/.github/scripts/libff.patch | patch -p1
4348fi
Original file line number Diff line number Diff line change 1+ set (CMAKE_SYSTEM_NAME Windows)
2+
3+ set (CMAKE_C_COMPILER "$ENV{HASKELL_MINGW_PATH} /bin/cc.exe" )
4+ set (CMAKE_CXX_COMPILER "$ENV{HASKELL_MINGW_PATH} /bin/c++.exe" )
5+
6+ set (CMAKE_C_FLAGS "-idirafter $ENV{SYSTEM_MINGW_PATH} /include" )
7+ set (CMAKE_CXX_FLAGS "-idirafter $ENV{SYSTEM_MINGW_PATH} /include" )
8+
9+ set (CMAKE_FIND_ROOT_PATH "$ENV{HASKELL_MINGW_PATH} " )
10+ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
11+ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
12+ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
Original file line number Diff line number Diff line change 4040 - name : Get Packages (Windows)
4141 uses : msys2/setup-msys2@v2
4242 if : runner.os == 'Windows'
43+ id : msys2
4344 with :
4445 msystem : CLANG64
4546 path-type : minimal
@@ -104,11 +105,16 @@ jobs:
104105 if : runner.os == 'Windows'
105106 run : |
106107 HASKELL_PATHS="$(cygpath -u "$GHC_PATH"):$(cygpath -u "$CABAL_PATH"):$(cygpath -u "$STACK_PATH")"
108+ HASKELL_MINGW_PATH="$(cygpath -u "$GHC_PATH/../mingw")"
109+ SYSTEM_MINGW_PATH="$(cygpath -m "$MSYS2_LOCATION/$MSYSTEM")"
107110 echo "HASKELL_PATHS=$HASKELL_PATHS" >> "$GITHUB_ENV"
111+ echo "HASKELL_MINGW_PATH=$HASKELL_MINGW_PATH" >> "$GITHUB_ENV"
112+ echo "SYSTEM_MINGW_PATH=$SYSTEM_MINGW_PATH" >> "$GITHUB_ENV"
108113 env :
109114 GHC_PATH : ${{ steps.stack.outputs.ghc-path }}
110115 CABAL_PATH : ${{ steps.stack.outputs.cabal-path }}
111116 STACK_PATH : ${{ steps.stack.outputs.stack-path }}
117+ MSYS2_LOCATION : ${{ steps.msys2.outputs.msys2-location }}
112118
113119 - name : Checkout
114120 uses : actions/checkout@v4
@@ -140,7 +146,7 @@ jobs:
140146 - name : Build Libraries
141147 run : |
142148 if [ "$HOST_OS" = "Windows" ]; then
143- export PATH="$(cygpath -u "$GHC_BIN_PATH/../mingw /bin"):$PATH"
149+ export PATH="$(cygpath -u "$HASKELL_MINGW_PATH /bin"):$PATH"
144150 fi
145151 .github/scripts/install-libsecp256k1.sh
146152 .github/scripts/install-libff.sh
You can’t perform that action at this time.
0 commit comments