From b738b87219e837191d02512e9d990852013064aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Sun, 28 Jul 2024 22:31:38 +0200 Subject: [PATCH] ci: windows: fix build with secp256k1 0.4.0+ See https://github.com/bitcoin-core/secp256k1/pull/1367 --- .github/workflows/build.yml | 2 +- hevm.cabal | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a487b83f..4fd860650 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -124,7 +124,7 @@ jobs: cabal configure --disable-documentation --enable-executable-static --enable-executable-stripping \ --extra-include-dirs="$HOME/.local/include" --extra-lib-dirs="$HOME/.local/lib" \ --extra-include-dirs="D:/a/_temp/msys64/clang64/include" --extra-lib-dirs="D:/a/_temp/msys64/clang64/lib" \ - --ghc-options=-pgml=D:/a/_temp/msys64/clang64/bin/clang.exe + --ghc-options=-pgml=D:/a/_temp/msys64/clang64/bin/clang.exe -fstatic-secp256k1 cabal build --dry-run # The last step generates dist-newstyle/cache/plan.json for the cache key. diff --git a/hevm.cabal b/hevm.cabal index 0cbe6000d..558958dd2 100644 --- a/hevm.cabal +++ b/hevm.cabal @@ -25,6 +25,11 @@ extra-source-files: extra-doc-files: CHANGELOG.md +flag static-secp256k1 + description: Sets flags for compilation with static secp256k1 + default: False + manual: True + flag ci description: Sets flags for compilation in CI default: False @@ -111,6 +116,9 @@ library Paths_hevm autogen-modules: Paths_hevm + if os(windows) && flag(static-secp256k1) + cc-options: -DSECP256K1_STATIC + cxx-options: -DSECP256K1_STATIC if os(darwin) -- https://gitlab.haskell.org/ghc/ghc/-/issues/11829 ld-options: -Wl,-keep_dwarf_unwind