diff options
| author | J08nY | 2025-03-27 10:49:21 +0100 |
|---|---|---|
| committer | J08nY | 2025-03-27 10:49:21 +0100 |
| commit | 0684f9dc440a4909d89392aa0c16fd9ba5249e76 (patch) | |
| tree | 0f24f183723537d8cb9536badb1c48940dbc4162 | |
| parent | 00281ebcad0c28999eeebb42058f679c234a5944 (diff) | |
| download | ecgen-0684f9dc440a4909d89392aa0c16fd9ba5249e76.tar.gz ecgen-0684f9dc440a4909d89392aa0c16fd9ba5249e76.tar.zst ecgen-0684f9dc440a4909d89392aa0c16fd9ba5249e76.zip | |
Add option to build ecgen statically in CMake.
| -rw-r--r-- | .github/workflows/test.yml | 8 | ||||
| -rw-r--r-- | CMakeLists.txt | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59de7c8..63aa95d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,14 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libpari-dev pari-gp pari-seadata meson ninja-build + - name: Build + run: | + make + make clean + make STATIC=1 + make clean + make DEBUG=1 + make clean - name: Test run: | TEST=1 make unittest diff --git a/CMakeLists.txt b/CMakeLists.txt index 04d8f36..a08c21c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,4 +28,10 @@ else () set(PLATFORM_SPECIFIC_LIBS rt) endif() -target_link_libraries(ecgen pthread pari parson sha1 ${PLATFORM_SPECIFIC_LIBS}) +if (STATIC) + # Find the static libpari library + find_library(PARI_STATIC NAMES libpari.a) + target_link_libraries(ecgen pthread ${PARI_STATIC} parson sha1 ${PLATFORM_SPECIFIC_LIBS}) +else () + target_link_libraries(ecgen pthread pari parson sha1 ${PLATFORM_SPECIFIC_LIBS}) +endif() |
