From f5d487193ba7cd345a1422aba35113eecc2cb3cd Mon Sep 17 00:00:00 2001 From: Antonio Rojas Date: Fri, 26 Dec 2025 11:24:06 +0100 Subject: [PATCH] Restore support for compiling against system primecount Was removed in 3d5f414d59bc8c6a0e14ba79c978bad5f32b2dc8 --- meson.build | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 1063278..5fc601b 100644 --- a/meson.build +++ b/meson.build @@ -15,11 +15,14 @@ cmake = import('cmake') # Compilers cxx = meson.get_compiler('cpp') -# Build bundled primecount with PIC so it can link into the Python extension. -primecount_opts = cmake.subproject_options() -primecount_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'}) -primecount_proj = cmake.subproject('primecount', options: primecount_opts) -primecount_dep = primecount_proj.dependency('libprimecount-static') +primecount_dep = dependency('primecount', version: '>=8', required: false) +if not primecount_dep.found() + # Build bundled primecount with PIC so it can link into the Python extension. + primecount_opts = cmake.subproject_options() + primecount_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'}) + primecount_proj = cmake.subproject('primecount', options: primecount_opts) + primecount_dep = primecount_proj.dependency('libprimecount-static') +endif inc_cysignals = run_command( py, [