2020-06-19 14:28:30 +08:00
|
|
|
################################################################################
|
|
|
|
# NPCOMPPythonCommon
|
|
|
|
################################################################################
|
|
|
|
|
2020-07-11 13:45:30 +08:00
|
|
|
include(AddLLVM)
|
2020-07-05 08:38:01 +08:00
|
|
|
include(NpcompPython)
|
2020-07-02 12:28:04 +08:00
|
|
|
|
2020-07-11 13:45:30 +08:00
|
|
|
# TODO: This should not be wired in at such a low/unconditional level.
|
|
|
|
# It is done here to be kept with the other LLVM initialization until a better
|
|
|
|
# place can be found for it.
|
|
|
|
set(ExtraInit_LIBADD)
|
|
|
|
if(NPCOMP_ENABLE_REFJIT)
|
|
|
|
llvm_map_components_to_libnames(refjit_llvm_libs
|
|
|
|
nativecodegen
|
|
|
|
)
|
|
|
|
message(STATUS "Including LLVM libs for RefJit: ${refjit_llvm_libs}")
|
|
|
|
list(APPEND ExtraInit_LIBADD
|
|
|
|
${refjit_llvm_libs})
|
|
|
|
endif()
|
|
|
|
|
2020-06-19 14:28:30 +08:00
|
|
|
set(PYBIND_SOURCES
|
2020-06-19 09:02:39 +08:00
|
|
|
MlirInit.cpp
|
|
|
|
MlirIr.cpp
|
|
|
|
MlirPass.cpp
|
|
|
|
NpcompDialect.cpp
|
|
|
|
CoreDialects.cpp
|
|
|
|
)
|
2020-06-19 14:28:30 +08:00
|
|
|
|
|
|
|
add_library(NPCOMPPythonCommon
|
|
|
|
${PYBIND_SOURCES}
|
|
|
|
)
|
2020-06-19 09:02:39 +08:00
|
|
|
|
|
|
|
target_link_libraries(NPCOMPPythonCommon
|
|
|
|
pybind11::module
|
|
|
|
|
|
|
|
NPCOMPInitAll
|
|
|
|
|
|
|
|
# Core dialects
|
|
|
|
MLIRSCF
|
|
|
|
|
|
|
|
# Upstream depends
|
|
|
|
MLIRDialect
|
|
|
|
MLIREDSC
|
|
|
|
MLIRIR
|
|
|
|
MLIRLLVMIR
|
|
|
|
MLIRPass
|
|
|
|
MLIRTransforms
|
|
|
|
)
|
2020-07-05 08:38:01 +08:00
|
|
|
|
|
|
|
npcomp_python_target_compile_options(NPCOMPPythonCommon)
|