Skip to content

Commit

Permalink
update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Aug 29, 2024
1 parent 63eab3c commit af0e82c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest] # , macos-13, macos-14
os: [windows-latest] # , ubuntu-latest, macos-13, macos-14
# cibw_archs: ["x86_64", ""]
#include:
# - os: ubuntu-latest
Expand Down
18 changes: 10 additions & 8 deletions build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@
from pathlib import Path
from tempfile import TemporaryDirectory


print("PY_EXE", sys.executable)
print("PY_INCLUDE", sysconfig.get_path('include'))
print("PY_LIBDIR", sysconfig.get_config_var('LIBDIR'))
print("PY_LDLIBRARY", sysconfig.get_config_var('LDLIBRARY'))
print("PY_INCLUDE", sysconfig.get_path("include"))
print("PY_LIBDIR", sysconfig.get_config_var("LIBDIR"))
print("PY_LDLIBRARY", sysconfig.get_config_var("LDLIBRARY"))


TOP_DIR = Path(__file__).parent

print("Platform", platform.system())
uname = platform.uname()
if uname.system == "Darwin":
os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.13"


def banner(msg: str) -> None:
print("=" * 80)
print(str.center(msg, 80))
Expand All @@ -35,16 +37,16 @@ def build_extension(debug: bool = False, use_temp_dir: bool = False) -> None:
debug = bool(os.environ.get("DEBUG", 0)) or debug
cfg = "Debug" if debug else "Release"
print(f" BUILD-TYPE: {cfg!r}")

cmake_args = [
f"-DPython3_EXECUTABLE={sys.executable}",
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
]

# if uname.system == 'Linux' and 'CIBUILDWHEEL' in os.environ:
# cmake_args += [f"-DPython3_INCLUDE_DIR={sysconfig.get_path('include')}"]
# cmake_args += [f"-DPython3_LIBRARY={str(Path(sysconfig.get_config_var('LIBDIR')) / Path(sysconfig.get_config_var('LDLIBRARY')))}"]

build_args = ["--config Release", "--verbose"]
# cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 /path/to/src

Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[build-system]
requires = ["poetry-core>=1.0.0", "setuptools>=68.0.0", "pybind11>=2.12.0", "pybind11[global]>=2.12.0"]
requires = ["poetry-core>=1.0.0", "pybind11>=2.12.0", "pybind11[global]>=2.12.0"] # "setuptools>=68.0.0",
build-backend = "poetry.core.masonry.api"


Expand Down Expand Up @@ -64,13 +64,13 @@ include = [
{ path = "pyxcp/recorder/*.pyd", format = "wheel" },
{ path = "pyxcp/*.exe", format = "wheel" },
{ path = "CMakeLists.txt", format = "sdist" },

{ path = "pyxcp/cpp_ext/*hpp", format = "sdist" },
{ path = "pyxcp/cpp_ext/*cpp", format = "sdist" },
{ path = "pyxcp/cpp_ext/*cpp", format = "sdist" },
{ path = "pyxcp/daq_stim/*hpp", format = "sdist" },
{ path = "pyxcp/daq_stim/*cpp", format = "sdist" },
{ path = "pyxcp/daq_stim/*cpp", format = "sdist" },
{ path = "pyxcp/recorder/*hpp", format = "sdist" },
{ path = "pyxcp/recorder/*cpp", format = "sdist" },
{ path = "pyxcp/recorder/*cpp", format = "sdist" },
]

[tool.poetry.dependencies]
Expand Down

0 comments on commit af0e82c

Please sign in to comment.