Skip to content

Commit

Permalink
Use makefile on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Dec 21, 2024
1 parent 79d2546 commit 7906c0d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions build_mdbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7906c0d

Please sign in to comment.