From 40fcf540d5b72f343b33f8cdfa8b16ad13b88026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nordl=C3=B6w?= Date: Wed, 21 Dec 2022 00:13:49 +0100 Subject: [PATCH 1/3] Provision GNU MP on Windows using vcpkg --- .github/workflows/d.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/d.yml b/.github/workflows/d.yml index 2de37eb..97a1ff9 100644 --- a/.github/workflows/d.yml +++ b/.github/workflows/d.yml @@ -14,12 +14,12 @@ permissions: contents: read jobs: - test: - name: Build and Test + test-ubuntu: + name: Build and Test on Ubuntu strategy: fail-fast: false matrix: - os: [ubuntu-latest] # TODO: provision gmp.lib using https://github.com/marketplace/actions/run-vcpkg and then add ‘windows-latest’ to list of os + os: [ubuntu-latest] dc: - dmd-latest - ldc-latest @@ -37,3 +37,26 @@ jobs: run: | dub build dub test + test-windows: + name: Build and Test on Windows + strategy: + fail-fast: false + matrix: + os: [windows-latest] # TODO: provision gmp.lib using https://github.com/marketplace/actions/run-vcpkg and then add ‘windows-latest’ to list of os + dc: + - dmd-latest + - ldc-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: dlang-community/setup-dlang@v1.3.0 + - uses: lukka/run-vcpkg@v10 + with: + compiler: ${{ matrix.dc }} + - name: 'Provision dependencies via vcpkg' + run: | + vcpkg install gmp + - name: 'Build & Test' + run: | + dub build + dub test From 5e972ee0ee19935a74a4c563bff0bdec13e67d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nordl=C3=B6w?= Date: Wed, 21 Dec 2022 00:31:54 +0100 Subject: [PATCH 2/3] Try setting vcpkgGitCommitId --- .github/workflows/d.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/d.yml b/.github/workflows/d.yml index 97a1ff9..bcd552f 100644 --- a/.github/workflows/d.yml +++ b/.github/workflows/d.yml @@ -48,9 +48,11 @@ jobs: - ldc-latest runs-on: ${{ matrix.os }} steps: + - uses: lukka/run-vcpkg@v10 + with: + vcpkgGitCommitId: "9bf374fb6d99f8973ec8781d3b41ffac2defee63" - uses: actions/checkout@v3 - uses: dlang-community/setup-dlang@v1.3.0 - - uses: lukka/run-vcpkg@v10 with: compiler: ${{ matrix.dc }} - name: 'Provision dependencies via vcpkg' From 0226bfbca2a94a24dbe32b2bf260f02cda93fa18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nordl=C3=B6w?= Date: Wed, 21 Dec 2022 10:38:23 +0100 Subject: [PATCH 3/3] Try removing pragma(lib, "gmp") --- src/gmp/f.d | 2 -- src/gmp/package.d | 2 -- src/gmp/q.d | 2 -- src/gmp/z.d | 1 - 4 files changed, 7 deletions(-) diff --git a/src/gmp/f.d b/src/gmp/f.d index 8103079..7e37b85 100644 --- a/src/gmp/f.d +++ b/src/gmp/f.d @@ -2,5 +2,3 @@ module gmp.f; import gmp.z; - -pragma(lib, "gmp"); diff --git a/src/gmp/package.d b/src/gmp/package.d index f60aa06..b83ef13 100644 --- a/src/gmp/package.d +++ b/src/gmp/package.d @@ -5,5 +5,3 @@ module gmp; public import gmp.z; public import gmp.q; public import gmp.f; - -pragma(lib, "gmp"); diff --git a/src/gmp/q.d b/src/gmp/q.d index 506a9ce..bdd6645 100644 --- a/src/gmp/q.d +++ b/src/gmp/q.d @@ -686,5 +686,3 @@ package extern(C) pragma(inline, false) void __gmpq_abs (mpq_ptr, mpq_srcptr); void __gmpq_inv (mpq_ptr, mpq_srcptr); } - -pragma(lib, "gmp"); diff --git a/src/gmp/z.d b/src/gmp/z.d index 19b03ed..6eb0d36 100644 --- a/src/gmp/z.d +++ b/src/gmp/z.d @@ -3961,5 +3961,4 @@ package extern(C) pragma(inline, false) int __gmpz_divisible_ui_p(mpz_srcptr, ulong); } -pragma(lib, "gmp"); pragma(lib, "c"); // needed by `malloc` and `free`