From 7906c0d835a634fd9ba49940f44bf61ea1ad5774 Mon Sep 17 00:00:00 2001 From: mio Date: Sat, 21 Dec 2024 18:58:05 +0800 Subject: [PATCH] Use makefile on Linux --- .github/workflows/wheels.yaml | 2 +- build_mdbx.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index 7520afc..810b559 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -35,7 +35,7 @@ jobs: env: CIBW_BUILD_FRONTEND: build # pip backend doesn't seem including our dynamic libraries CIBW_BUILD: "cp39*" - CIBW_BEFORE_BUILD_LINUX: yum install -y ninja-build git && cd libmdbx && git fetch --tags + CIBW_BEFORE_BUILD_LINUX: yum install -y git && cd libmdbx && git fetch --tags CIBW_BEFORE_BUILD_WINDOWS: choco install ninja cmake git && cd libmdbx && git fetch --tags CIBW_BEFORE_BUILD_MACOS: brew install ninja cmake git && cd libmdbx && git fetch --tags CIBW_TEST_REQUIRES: pytest diff --git a/build_mdbx.py b/build_mdbx.py index 5ad513d..046d921 100644 --- a/build_mdbx.py +++ b/build_mdbx.py @@ -39,9 +39,18 @@ def build(setup_kws: dict): build_type = ["-DCMAKE_BUILD_TYPE=Debug"] else: build_type = ["-DCMAKE_BUILD_TYPE=Release"] - + + cmake_gen = ["cmake"] + + if sys.platform == "win32" or sys.platform == "darwin": + cmake_gen += ["-G", "Ninja"] + + cmake_gen += [ + "-S", str(libmdbx_source.absolute()), "-B", str(tmpdir_path.absolute()) + ] + cmake_gen += build_type subprocess.check_call( - ["cmake", "-G", "Ninja", "-S", str(libmdbx_source.absolute()), "-B", str(tmpdir_path.absolute())] + build_type, + cmake_gen, cwd=tmpdir_path ) threads = multiprocessing.cpu_count()