Creating an empty Python module
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
ee0a5374d8
commit
d62f7abd95
@ -48,12 +48,12 @@ foreach (family ${FAMILIES})
|
|||||||
aux_source_directory(${family}/ ${ufamily}_FILES)
|
aux_source_directory(${family}/ ${ufamily}_FILES)
|
||||||
add_executable(nextpnr-${family} ${COMMON_FILES} ${${ufamily}_FILES})
|
add_executable(nextpnr-${family} ${COMMON_FILES} ${${ufamily}_FILES})
|
||||||
# TODO: also build an importable Python module
|
# TODO: also build an importable Python module
|
||||||
# PYTHON_ADD_MODULE(pynextpnr_${family} ${COMMON_FILES} ${${ufamily}_FILES})
|
PYTHON_ADD_MODULE(nextpnrpy_${family} ${COMMON_FILES} ${${ufamily}_FILES})
|
||||||
set(family_targets nextpnr-${family})
|
set(family_targets nextpnr-${family} nextpnrpy_${family})
|
||||||
include(${family}/family.cmake)
|
include(${family}/family.cmake)
|
||||||
foreach (target ${family_targets})
|
foreach (target ${family_targets})
|
||||||
target_include_directories(${target} PRIVATE ${family}/)
|
target_include_directories(${target} PRIVATE ${family}/)
|
||||||
target_compile_definitions(${target} PRIVATE ARCH_${ufamily} ARCHNAME="${family}")
|
target_compile_definitions(${target} PRIVATE ARCH_${ufamily} ARCHNAME=${family})
|
||||||
target_link_libraries(${target} LINK_PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
|
target_link_libraries(${target} LINK_PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
|
||||||
endforeach (target)
|
endforeach (target)
|
||||||
endforeach (family)
|
endforeach (family)
|
||||||
|
15
common/pybindings.cc
Normal file
15
common/pybindings.cc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include "design.h"
|
||||||
|
#include "chip.h"
|
||||||
|
|
||||||
|
#include <boost/python.hpp>
|
||||||
|
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
|
||||||
|
#include <boost/python/suite/indexing/map_indexing_suite.hpp>
|
||||||
|
using namespace boost::python;
|
||||||
|
|
||||||
|
#define PASTER(x,y) x ## _ ## y
|
||||||
|
#define EVALUATOR(x,y) PASTER(x,y)
|
||||||
|
#define MODULE_NAME EVALUATOR(nextpnrpy, ARCHNAME)
|
||||||
|
|
||||||
|
BOOST_PYTHON_MODULE (MODULE_NAME) {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user