mirror of
https://github.com/YosysHQ/yosys
synced 2026-06-06 00:50:57 +00:00
Update top-level Python project for CMake compatibility.
This commit reimplements the (no longer recommended) setuptools based build system using a standards-based in-tree PEP517 build backend. The implementation is partially based on https://codeberg.org/ziglang/zig-pypi/src/branch/main/make_wheels.py which is licensed under BSD-0-clause. It also adds a new option `YOSYS_BUILD_PYTHON_ONLY` that is available only if the binary or the library aren't going to be installed, which turns off these targets entirely, as well as some dependent ones (e.g. tests). Co-authored-by: Mohamed Gaber <me@donn.website>
This commit is contained in:
parent
780588f28c
commit
afc0e78d11
15 changed files with 321 additions and 294 deletions
|
|
@ -96,7 +96,7 @@ yosys_core(kernel
|
|||
$<${YOSYS_ENABLE_READLINE}:PkgConfig::readline>
|
||||
$<${YOSYS_ENABLE_EDITLINE}:PkgConfig::editline>
|
||||
$<${YOSYS_ENABLE_TCL}:PkgConfig::tcl>
|
||||
$<${YOSYS_ENABLE_PYTHON}:Python3::Python>
|
||||
$<${YOSYS_ENABLE_PYTHON}:Python3::Module>
|
||||
REQUIRES
|
||||
bigint
|
||||
ezsat
|
||||
|
|
@ -172,16 +172,18 @@ yosys_core(fstdata
|
|||
fstdata.h
|
||||
)
|
||||
|
||||
yosys_core(driver
|
||||
driver.cc
|
||||
INCLUDE_DIRS
|
||||
${pybind11_INCLUDE_DIR}
|
||||
LIBRARIES
|
||||
$<${YOSYS_ENABLE_READLINE}:PkgConfig::readline>
|
||||
$<${YOSYS_ENABLE_EDITLINE}:PkgConfig::editline>
|
||||
$<${YOSYS_ENABLE_TCL}:PkgConfig::tcl>
|
||||
$<${YOSYS_ENABLE_PYTHON}:Python3::Python>
|
||||
REQUIRES
|
||||
essentials
|
||||
BOOTSTRAP
|
||||
)
|
||||
if (NOT YOSYS_BUILD_PYTHON_ONLY)
|
||||
yosys_core(driver
|
||||
driver.cc
|
||||
INCLUDE_DIRS
|
||||
${pybind11_INCLUDE_DIR}
|
||||
LIBRARIES
|
||||
$<${YOSYS_ENABLE_READLINE}:PkgConfig::readline>
|
||||
$<${YOSYS_ENABLE_EDITLINE}:PkgConfig::editline>
|
||||
$<${YOSYS_ENABLE_TCL}:PkgConfig::tcl>
|
||||
$<${YOSYS_ENABLE_PYTHON}:Python3::Python>
|
||||
REQUIRES
|
||||
essentials
|
||||
BOOTSTRAP
|
||||
)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue