Files
yosys/pyosys/CMakeLists.txt
T
tangxifan 02dc5a82d7 [core] add a cmake option to disable unit test during compilation; Use cmake_current_source for submodule integration
[core] debug yosys version extraction

[core] debug

[core] now cache the cmake source dir

[core] debug

[core] debug kernel dependencies

[core] debug common include directories

[core] debug

[core] debug simlib_help.inc

[core] debug pmgen py path in cmake

[core] syntax

[core] debug flex source

[core] restore

[core] debug executable output as it now shows linking to .

[core] debug yosys-abc directory

[core] debug cmake share directory

[core] debug yosys abc

[core] restore shared directory location as yosys requires fixed location

[core] rework link target to yosys sub dir under build

[core] fixed the bug on yosys-config.install location for install

[core] cmake syntax

[core] correct the location for share directory

[core] debug

[core] debug

[core] debug

[core] enforce internal attributes; rename the YOSYS_ENABLE_UNIT_TESTS; use YOSYS_CMAKE_BINARY_DIR for all

[core] apply review comments

[core] rename

[core] change all the CMAKE_BINARY_DIR to YOSYS_CMAKE_BINARY_DIR

[core] replace CMAKE_SOURCE_DIR to YOSYS_CMAKE_SOURCE_DIR
2026-08-21 12:09:04 -07:00

30 lines
750 B
CMake

add_custom_command(
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/generator.py
${CMAKE_CURRENT_SOURCE_DIR}/wrappers_tpl.cc
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/wrappers.cc
${CMAKE_CURRENT_BINARY_DIR}/wrappers.inc.cc
DEPFILE
${CMAKE_CURRENT_BINARY_DIR}/wrappers.cc.d
COMMAND
${CMAKE_COMMAND} -E env
CCACHE=${CMAKE_CXX_COMPILER_LAUNCHER}
CXX=${CMAKE_CXX_COMPILER}
CXX_STD=c++${CMAKE_CXX_STANDARD}
-- ${PyosysEnv_PYTHON}
${CMAKE_CURRENT_SOURCE_DIR}/generator.py
${CMAKE_CURRENT_BINARY_DIR}/wrappers.cc
--build-dir ${YOSYS_CMAKE_BINARY_DIR}
VERBATIM
COMMENT "Generating Python wrappers"
)
yosys_core(pyosys
wrappers.cc
INCLUDE_DIRS
${pybind11_INCLUDE_DIR}
LIBRARIES
$<${YOSYS_ENABLE_PYTHON}:Python3::Module>
ESSENTIAL
)