WIP: refactoring of setup.py

This commit is contained in:
Matthias Koefferlein 2025-11-09 14:34:26 +01:00
parent 9a65cd252c
commit c6f3147755
1 changed files with 205 additions and 217 deletions

422
setup.py
View File

@ -286,6 +286,14 @@ class Config(object):
self.root = "klayout"
self.modules = { }
def module(self, name, src_path):
self.modules[name] = src_path
def src_path(self, name):
return self.modules[name]
def add_extension(self, ext):
self.build_ext_cmd.ext_map[ext.name] = ext
@ -316,49 +324,51 @@ class Config(object):
ext_filename = ext_filename.replace(".so", ".dylib")
return ext_filename
def path_of(self, mod, mod_src_path):
def path_of(self, mod):
"""
Returns the build path of the library for a given module
"""
if platform.system() == "Windows":
# On Windows, the library to link is the import library
(dll_name, dll_ext) = os.path.splitext(self.libname_of(mod))
return os.path.join(self.build_temp, mod_src_path, dll_name + ".lib")
return os.path.join(self.build_temp, self.modules[mod], dll_name + ".lib")
else:
return os.path.join(self.build_platlib, self.root, self.libname_of(mod))
def extra_include_dirs(self, mod, root):
def extra_include_dirs(self, mod):
"""
Gets extra include directories per module
"""
if mod == "_lstream_dbpi":
mod_src = self.src_path(mod)
return [
os.path.join("src", "version"), # does not use tlVersion.h
os.path.join(root, "capnp"),
os.path.join(root, "..", "runtime", "capnp"),
os.path.join(root, "..", "runtime", "kj")
os.path.join(mod_src, "capnp"),
os.path.join(mod_src, "..", "runtime", "capnp"),
os.path.join(mod_src, "..", "runtime", "kj")
]
else:
return []
def sources(self, mod, root):
def sources(self, mod):
"""
Gets the source files for the given module and root source path
"""
mod_src = self.src_path(mod)
if mod == "_gds2_dbpi":
# GDS2 module has the contrib subfolder
files = glob.glob(os.path.join(root, "*.cc"))
files += glob.glob(os.path.join(root, "contrib", "*.cc"))
files = glob.glob(os.path.join(mod_src, "*.cc"))
files += glob.glob(os.path.join(mod_src, "contrib", "*.cc"))
return files
elif mod == "_lstream_dbpi":
# LStream module is .. complex
files = glob.glob(os.path.join(root, "*.cc"))
files += glob.glob(os.path.join(root, "capnp", "*.cc"))
files += glob.glob(os.path.join(root, "..", "runtime", "capnp", "capnp", "*.cc"))
files += glob.glob(os.path.join(root, "..", "runtime", "kj", "kj", "*.cc"))
files = glob.glob(os.path.join(mod_src, "*.cc"))
files += glob.glob(os.path.join(mod_src, "capnp", "*.cc"))
files += glob.glob(os.path.join(mod_src, "..", "runtime", "capnp", "capnp", "*.cc"))
files += glob.glob(os.path.join(mod_src, "..", "runtime", "kj", "kj", "*.cc"))
return files
else:
return glob.glob(os.path.join(root, "*.cc"))
return glob.glob(os.path.join(mod_src, "*.cc"))
def compile_args(self, mod):
"""
@ -542,8 +552,7 @@ config = Config()
# ------------------------------------------------------------------
# _tl dependency library
_tl_path = os.path.join("src", "tl", "tl")
_tl_sources = set(config.sources("_tl", _tl_path))
config.module("_tl", os.path.join("src", "tl", "tl"))
_tl = Library(
config.root + "._tl",
@ -552,7 +561,7 @@ _tl = Library(
libraries=config.libraries("_tl"),
extra_link_args=config.link_args("_tl"),
extra_compile_args=config.compile_args("_tl"),
sources=list(_tl_sources),
sources=config.sources("_tl")
)
config.add_extension(_tl)
@ -560,294 +569,281 @@ config.add_extension(_tl)
# ------------------------------------------------------------------
# _gsi dependency library
_gsi_path = os.path.join("src", "gsi", "gsi")
_gsi_sources = set(config.sources("_gsi", _gsi_path))
config.module("_gsi", os.path.join("src", "gsi", "gsi"))
_gsi = Library(
config.root + "._gsi",
define_macros=config.macros() + [("MAKE_GSI_LIBRARY", 1)],
include_dirs=[_tl_path],
extra_objects=[config.path_of("_tl", _tl_path)],
include_dirs=[config.src_path("_tl")],
extra_objects=[config.path_of("_tl")],
language="c++",
libraries=config.libraries('_gsi'),
extra_link_args=config.link_args("_gsi"),
extra_compile_args=config.compile_args("_gsi"),
sources=list(_gsi_sources),
sources=config.sources("_gsi")
)
config.add_extension(_gsi)
# ------------------------------------------------------------------
# _pya dependency library
_pya_path = os.path.join("src", "pya", "pya")
_pya_sources = set(config.sources("_pya", _pya_path))
config.module("_pya", os.path.join("src", "pya", "pya"))
_version_path = os.path.join("src", "version")
_pya = Library(
config.root + "._pya",
define_macros=config.macros() + [("MAKE_PYA_LIBRARY", 1)],
include_dirs=[_version_path, _tl_path, _gsi_path],
extra_objects=[config.path_of("_tl", _tl_path), config.path_of("_gsi", _gsi_path)],
include_dirs=[_version_path, config.src_path("_tl"), config.src_path("_gsi")],
extra_objects=[config.path_of("_tl"), config.path_of("_gsi")],
language="c++",
libraries=config.libraries('_pya'),
libraries=config.libraries("_pya"),
extra_link_args=config.link_args("_pya"),
extra_compile_args=config.compile_args("_pya"),
sources=list(_pya_sources),
sources=config.sources("_pya")
)
config.add_extension(_pya)
# ------------------------------------------------------------------
# _rba dependency library (dummy)
_rba_path = os.path.join("src", "rbastub")
_rba_sources = set(config.sources("_rba", _rba_path))
config.module("_rba", os.path.join("src", "rbastub"))
_rba = Library(
config.root + '._rba',
define_macros=config.macros() + [('MAKE_RBA_LIBRARY', 1)],
include_dirs=[_tl_path, _gsi_path],
extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path)],
language='c++',
libraries=config.libraries('_rba'),
extra_link_args=config.link_args('_rba'),
extra_compile_args=config.compile_args('_rba'),
sources=list(_rba_sources)
include_dirs=[config.src_path("_tl"), config.src_path("_gsi")],
extra_objects=[config.path_of("_tl"), config.path_of("_gsi")],
language="c++",
libraries=config.libraries("_rba"),
extra_link_args=config.link_args("_rba"),
extra_compile_args=config.compile_args("_rba"),
sources=config.sources("_rba")
)
config.add_extension(_rba)
# ------------------------------------------------------------------
# _db dependency library
_db_path = os.path.join("src", "db", "db")
_db_sources = set(config.sources("_db", _db_path))
config.module("_db", os.path.join("src", "db", "db"))
_db = Library(
config.root + "._db",
define_macros=config.macros() + [("MAKE_DB_LIBRARY", 1)],
include_dirs=[_tl_path, _gsi_path, _db_path],
extra_objects=[config.path_of("_tl", _tl_path), config.path_of("_gsi", _gsi_path)],
include_dirs=[config.src_path("_tl"), config.src_path("_gsi"), config.src_path("_db")],
extra_objects=[config.path_of("_tl"), config.path_of("_gsi")],
language="c++",
libraries=config.libraries('_db'),
libraries=config.libraries("_db"),
extra_link_args=config.link_args("_db"),
extra_compile_args=config.compile_args("_db"),
sources=list(_db_sources),
sources=config.sources("_db")
)
config.add_extension(_db)
# ------------------------------------------------------------------
# _pex dependency library
_pex_path = os.path.join("src", "pex", "pex")
_pex_sources = set(config.sources("_pex", _pex_path))
config.module("_pex", os.path.join("src", "pex", "pex"))
_pex = Library(
config.root + "._pex",
define_macros=config.macros() + [("MAKE_PEX_LIBRARY", 1)],
include_dirs=[_tl_path, _gsi_path, _db_path, _pex_path],
extra_objects=[config.path_of("_tl", _tl_path), config.path_of("_gsi", _gsi_path), config.path_of("_db", _db_path)],
include_dirs=[config.src_path("_tl"), config.src_path("_gsi"), config.src_path("_db"), config.src_path("_pex")],
extra_objects=[config.path_of("_tl"), config.path_of("_gsi"), config.path_of("_db")],
language="c++",
libraries=config.libraries('_pex'),
libraries=config.libraries("_pex"),
extra_link_args=config.link_args("_pex"),
extra_compile_args=config.compile_args("_pex"),
sources=list(_pex_sources),
sources=config.sources("_pex")
)
config.add_extension(_pex)
# ------------------------------------------------------------------
# _lib dependency library
_lib_path = os.path.join("src", "lib", "lib")
_lib_sources = set(config.sources("_lib", _lib_path))
config.module("_lib", os.path.join("src", "lib", "lib"))
_lib = Library(
config.root + "._lib",
define_macros=config.macros() + [("MAKE_LIB_LIBRARY", 1)],
include_dirs=[_tl_path, _gsi_path, _db_path, _lib_path],
include_dirs=[config.src_path("_tl"), config.src_path("_gsi"), config.src_path("_db"), config.src_path("_lib")],
extra_objects=[
config.path_of("_tl", _tl_path),
config.path_of("_gsi", _gsi_path),
config.path_of("_db", _db_path),
config.path_of("_tl"),
config.path_of("_gsi"),
config.path_of("_db"),
],
language="c++",
libraries=config.libraries('_lib'),
libraries=config.libraries("_lib"),
extra_link_args=config.link_args("_lib"),
extra_compile_args=config.compile_args("_lib"),
sources=list(_lib_sources),
sources=config.sources("_lib")
)
config.add_extension(_lib)
# ------------------------------------------------------------------
# _rdb dependency library
_rdb_path = os.path.join("src", "rdb", "rdb")
_rdb_sources = set(config.sources("_rdb", _rdb_path))
config.module("_rdb", os.path.join("src", "rdb", "rdb"))
_rdb = Library(
config.root + "._rdb",
define_macros=config.macros() + [("MAKE_RDB_LIBRARY", 1)],
include_dirs=[_db_path, _tl_path, _gsi_path],
include_dirs=[config.src_path("_db"), config.src_path("_tl"), config.src_path("_gsi")],
extra_objects=[
config.path_of("_tl", _tl_path),
config.path_of("_gsi", _gsi_path),
config.path_of("_db", _db_path),
config.path_of("_tl"),
config.path_of("_gsi"),
config.path_of("_db"),
],
language="c++",
libraries=config.libraries('_rdb'),
extra_link_args=config.link_args("_rdb"),
extra_compile_args=config.compile_args("_rdb"),
sources=list(_rdb_sources),
sources=config.sources("_rdb")
)
config.add_extension(_rdb)
# ------------------------------------------------------------------
# _laybasic dependency library
_laybasic_path = os.path.join("src", "laybasic", "laybasic")
_laybasic_sources = set(config.sources("_laybasic", _laybasic_path))
config.module("_laybasic", os.path.join("src", "laybasic", "laybasic"))
_laybasic = Library(
config.root + '._laybasic',
define_macros=config.macros() + [('MAKE_LAYBASIC_LIBRARY', 1)],
include_dirs=[_rdb_path, _db_path, _tl_path, _gsi_path],
include_dirs=[config.src_path("_rdb"), config.src_path("_db"), config.src_path("_tl"), config.src_path("_gsi")],
extra_objects=[
config.path_of('_rdb', _rdb_path),
config.path_of('_tl', _tl_path),
config.path_of('_gsi', _gsi_path),
config.path_of('_db', _db_path)
config.path_of('_rdb'),
config.path_of('_tl'),
config.path_of('_gsi'),
config.path_of('_db')
],
language='c++',
libraries=config.libraries('_laybasic'),
extra_link_args=config.link_args('_laybasic'),
extra_compile_args=config.compile_args('_laybasic'),
sources=list(_laybasic_sources)
sources=config.sources("_laybasic")
)
config.add_extension(_laybasic)
# ------------------------------------------------------------------
# _layview dependency library
_layview_path = os.path.join("src", "layview", "layview")
_layview_sources = set(config.sources("_layview", _layview_path))
config.module("_layview", os.path.join("src", "layview", "layview"))
_layview = Library(
config.root + '._layview',
define_macros=config.macros() + [('MAKE_LAYVIEW_LIBRARY', 1)],
include_dirs=[_laybasic_path, _rdb_path, _db_path, _tl_path, _gsi_path],
include_dirs=[config.src_path("_laybasic"), config.src_path("_rdb"), config.src_path("_db"), config.src_path("_tl"), config.src_path("_gsi")],
extra_objects=[
config.path_of('_laybasic', _laybasic_path),
config.path_of('_rdb', _rdb_path),
config.path_of('_tl', _tl_path),
config.path_of('_gsi', _gsi_path),
config.path_of('_db', _db_path)
config.path_of('_laybasic'),
config.path_of('_rdb'),
config.path_of('_tl'),
config.path_of('_gsi'),
config.path_of('_db')
],
language='c++',
libraries=config.libraries('_layview'),
extra_link_args=config.link_args('_layview'),
extra_compile_args=config.compile_args('_layview'),
sources=list(_layview_sources)
sources=config.sources("_layview")
)
config.add_extension(_layview)
# ------------------------------------------------------------------
# _lym dependency library
_lym_path = os.path.join("src", "lym", "lym")
_lym_sources = set(config.sources("_lym", _lym_path))
config.module("_lym", os.path.join("src", "lym", "lym"))
_lym = Library(
config.root + '._lym',
define_macros=config.macros() + [('MAKE_LYM_LIBRARY', 1)],
include_dirs=[_pya_path, _rba_path, _tl_path, _gsi_path],
include_dirs=[config.src_path("_pya"), config.src_path("_rba"), config.src_path("_tl"), config.src_path("_gsi")],
extra_objects=[
config.path_of('_rba', _rba_path),
config.path_of('_pya', _pya_path),
config.path_of('_tl', _tl_path),
config.path_of('_gsi', _gsi_path)
config.path_of('_rba'),
config.path_of('_pya'),
config.path_of('_tl'),
config.path_of('_gsi')
],
language='c++',
libraries=config.libraries('_lym'),
extra_link_args=config.link_args('_lym'),
extra_compile_args=config.compile_args('_lym'),
sources=list(_lym_sources)
sources=config.sources("_lym")
)
config.add_extension(_lym)
# ------------------------------------------------------------------
# _ant dependency library
_ant_path = os.path.join("src", "ant", "ant")
_ant_sources = set(config.sources("_ant", _ant_path))
config.module("_ant", os.path.join("src", "ant", "ant"))
_ant = Library(
config.root + '._ant',
define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)],
include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path],
include_dirs=[config.src_path("_laybasic"), config.src_path("_layview"), config.src_path("_rdb"), config.src_path("_db"), config.src_path("_tl"), config.src_path("_gsi")],
extra_objects=[
config.path_of('_laybasic', _laybasic_path),
config.path_of('_layview', _layview_path),
config.path_of('_rdb', _rdb_path),
config.path_of('_tl', _tl_path),
config.path_of('_gsi', _gsi_path),
config.path_of('_db', _db_path)
config.path_of('_laybasic'),
config.path_of('_layview'),
config.path_of('_rdb'),
config.path_of('_tl'),
config.path_of('_gsi'),
config.path_of('_db')
],
language='c++',
libraries=config.libraries('_ant'),
extra_link_args=config.link_args('_ant'),
extra_compile_args=config.compile_args('_ant'),
sources=list(_ant_sources)
sources=config.sources("_ant")
)
config.add_extension(_ant)
# ------------------------------------------------------------------
# _img dependency library
_img_path = os.path.join("src", "img", "img")
_img_sources = set(config.sources("_img", _img_path))
config.module("_img", os.path.join("src", "img", "img"))
_img = Library(
config.root + '._img',
define_macros=config.macros() + [('MAKE_IMG_LIBRARY', 1)],
include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path],
include_dirs=[config.src_path("_laybasic"), config.src_path("_layview"), config.src_path("_rdb"), config.src_path("_db"), config.src_path("_tl"), config.src_path("_gsi")],
extra_objects=[
config.path_of('_laybasic', _laybasic_path),
config.path_of('_layview', _layview_path),
config.path_of('_rdb', _rdb_path),
config.path_of('_tl', _tl_path),
config.path_of('_gsi', _gsi_path),
config.path_of('_db', _db_path)
config.path_of('_laybasic'),
config.path_of('_layview'),
config.path_of('_rdb'),
config.path_of('_tl'),
config.path_of('_gsi'),
config.path_of('_db')
],
language='c++',
libraries=config.libraries('_img'),
extra_link_args=config.link_args('_img'),
extra_compile_args=config.compile_args('_img'),
sources=list(_img_sources)
sources=config.sources("_img")
)
config.add_extension(_img)
# ------------------------------------------------------------------
# _edt dependency library
_edt_path = os.path.join("src", "edt", "edt")
_edt_sources = set(config.sources("_edt", _edt_path))
config.module("_edt", os.path.join("src", "edt", "edt"))
_edt = Library(
config.root + '._edt',
define_macros=config.macros() + [('MAKE_EDT_LIBRARY', 1)],
include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path],
include_dirs=[config.src_path("_laybasic"), config.src_path("_layview"), config.src_path("_rdb"), config.src_path("_db"), config.src_path("_tl"), config.src_path("_gsi")],
extra_objects=[
config.path_of('_laybasic', _laybasic_path),
config.path_of('_layview', _layview_path),
config.path_of('_rdb', _rdb_path),
config.path_of('_tl', _tl_path),
config.path_of('_gsi', _gsi_path),
config.path_of('_db', _db_path)
config.path_of('_laybasic'),
config.path_of('_layview'),
config.path_of('_rdb'),
config.path_of('_tl'),
config.path_of('_gsi'),
config.path_of('_db')
],
language='c++',
libraries=config.libraries('_edt'),
extra_link_args=config.link_args('_edt'),
extra_compile_args=config.compile_args('_edt'),
sources=list(_edt_sources)
sources=config.sources("_edt")
)
config.add_extension(_edt)
@ -862,8 +858,7 @@ dbpi_dirs += glob.glob(os.path.join("src", "plugins", "*", "*", "db_plugin"))
for pi in dbpi_dirs:
mod_name = "_" + os.path.split(os.path.split(pi)[-2])[-1] + "_dbpi"
pi_sources = set(config.sources(mod_name, pi))
config.module(mod_name, pi)
pi_ext = Library(
config.root + ".db_plugins." + mod_name,
@ -871,19 +866,19 @@ for pi in dbpi_dirs:
include_dirs=[
pi,
os.path.join("src", "plugins", "common"),
_db_path,
_tl_path,
_gsi_path,
] + config.extra_include_dirs(mod_name, pi),
config.src_path("_db"),
config.src_path("_tl"),
config.src_path("_gsi")
] + config.extra_include_dirs(mod_name),
extra_objects=[
config.path_of("_tl", _tl_path),
config.path_of("_gsi", _gsi_path),
config.path_of("_db", _db_path),
config.path_of("_tl"),
config.path_of("_gsi"),
config.path_of("_db"),
],
language="c++",
extra_link_args=config.link_args(mod_name),
extra_compile_args=config.compile_args(mod_name),
sources=list(pi_sources),
sources=config.sources(mod_name)
)
db_plugins.append(pi_ext)
@ -892,173 +887,166 @@ for pi in dbpi_dirs:
# ------------------------------------------------------------------
# tl extension library
tl_path = os.path.join("src", "pymod", "tl")
tl_sources = set(config.sources("tlcore", tl_path))
config.module("tlcore", os.path.join("src", "pymod", "tl"))
tl = Extension(
config.root + ".tlcore",
define_macros=config.macros(),
include_dirs=[_tl_path, _gsi_path, _pya_path],
include_dirs=[config.src_path("_tl"), config.src_path("_gsi"), config.src_path("_pya")],
extra_objects=[
config.path_of("_tl", _tl_path),
config.path_of("_gsi", _gsi_path),
config.path_of("_pya", _pya_path),
config.path_of("_tl"),
config.path_of("_gsi"),
config.path_of("_pya"),
],
extra_link_args=config.link_args("tlcore"),
extra_compile_args=config.compile_args("tlcore"),
sources=list(tl_sources),
sources=config.sources("tlcore")
)
# ------------------------------------------------------------------
# db extension library
db_path = os.path.join("src", "pymod", "db")
db_sources = set(config.sources("dbcore", db_path))
config.module("dbcore", os.path.join("src", "pymod", "db"))
db = Extension(
config.root + ".dbcore",
define_macros=config.macros(),
include_dirs=[_db_path, _tl_path, _gsi_path, _pya_path],
include_dirs=[config.src_path("_db"), config.src_path("_tl"), config.src_path("_gsi"), config.src_path("_pya")],
extra_objects=[
config.path_of("_db", _db_path),
config.path_of("_tl", _tl_path),
config.path_of("_gsi", _gsi_path),
config.path_of("_pya", _pya_path),
config.path_of("_db"),
config.path_of("_tl"),
config.path_of("_gsi"),
config.path_of("_pya"),
],
extra_link_args=config.link_args("dbcore"),
extra_compile_args=config.compile_args("dbcore"),
sources=list(db_sources),
sources=config.sources("dbcore")
)
# ------------------------------------------------------------------
# pex extension library
pex_path = os.path.join("src", "pymod", "pex")
pex_sources = set(config.sources("pexcore", pex_path))
config.module("pexcore", os.path.join("src", "pymod", "pex"))
pex = Extension(
config.root + ".pexcore",
define_macros=config.macros(),
include_dirs=[_db_path, _tl_path, _gsi_path, _pya_path, _pex_path],
include_dirs=[config.src_path("_db"), config.src_path("_tl"), config.src_path("_gsi"), config.src_path("_pya"), config.src_path("_pex")],
extra_objects=[
config.path_of("_db", _db_path),
config.path_of("_pex", _pex_path),
config.path_of("_tl", _tl_path),
config.path_of("_gsi", _gsi_path),
config.path_of("_pya", _pya_path),
config.path_of("_db"),
config.path_of("_pex"),
config.path_of("_tl"),
config.path_of("_gsi"),
config.path_of("_pya"),
],
extra_link_args=config.link_args("pexcore"),
extra_compile_args=config.compile_args("pexcore"),
sources=list(pex_sources),
sources=config.sources("pexcore")
)
# ------------------------------------------------------------------
# lib extension library
lib_path = os.path.join("src", "pymod", "lib")
lib_sources = set(config.sources("libcore", lib_path))
config.module("libcore", os.path.join("src", "pymod", "lib"))
lib = Extension(
config.root + ".libcore",
define_macros=config.macros(),
include_dirs=[_lib_path, _tl_path, _gsi_path, _pya_path],
include_dirs=[config.src_path("_lib"), config.src_path("_tl"), config.src_path("_gsi"), config.src_path("_pya")],
extra_objects=[
config.path_of("_lib", _lib_path),
config.path_of("_tl", _tl_path),
config.path_of("_gsi", _gsi_path),
config.path_of("_pya", _pya_path),
config.path_of("_lib"),
config.path_of("_tl"),
config.path_of("_gsi"),
config.path_of("_pya"),
],
extra_link_args=config.link_args("libcore"),
extra_compile_args=config.compile_args("libcore"),
sources=list(lib_sources),
sources=config.sources("libcore")
)
# ------------------------------------------------------------------
# rdb extension library
rdb_path = os.path.join("src", "pymod", "rdb")
rdb_sources = set(config.sources("rdbcore", rdb_path))
config.module("rdbcore", os.path.join("src", "pymod", "rdb"))
rdb = Extension(
config.root + ".rdbcore",
define_macros=config.macros(),
include_dirs=[_rdb_path, _tl_path, _gsi_path, _pya_path],
include_dirs=[config.src_path("_rdb"), config.src_path("_tl"), config.src_path("_gsi"), config.src_path("_pya")],
extra_objects=[
config.path_of("_rdb", _rdb_path),
config.path_of("_tl", _tl_path),
config.path_of("_gsi", _gsi_path),
config.path_of("_pya", _pya_path),
config.path_of("_rdb"),
config.path_of("_tl"),
config.path_of("_gsi"),
config.path_of("_pya"),
],
extra_link_args=config.link_args("rdbcore"),
extra_compile_args=config.compile_args("rdbcore"),
sources=list(rdb_sources),
sources=config.sources("rdbcore")
)
# ------------------------------------------------------------------
# lay extension library
lay_path = os.path.join("src", "pymod", "lay")
lay_sources = set(config.sources("laycore", lay_path))
config.module("laycore", os.path.join("src", "pymod", "lay"))
lay = Extension(config.root + '.laycore',
define_macros=config.macros(),
include_dirs=[_laybasic_path,
_layview_path,
_img_path,
_ant_path,
_edt_path,
_lym_path,
_tl_path,
_gsi_path,
_pya_path],
extra_objects=[config.path_of('_laybasic', _laybasic_path),
config.path_of('_layview', _layview_path),
config.path_of('_img', _img_path),
config.path_of('_ant', _ant_path),
config.path_of('_edt', _edt_path),
config.path_of('_lym', _lym_path),
config.path_of('_tl', _tl_path),
config.path_of('_gsi', _gsi_path),
config.path_of('_pya', _pya_path)],
include_dirs=[config.src_path("_laybasic"),
config.src_path("_layview"),
config.src_path("_img"),
config.src_path("_ant"),
config.src_path("_edt"),
config.src_path("_lym"),
config.src_path("_tl"),
config.src_path("_gsi"),
config.src_path("_pya")],
extra_objects=[config.path_of('_laybasic'),
config.path_of('_layview'),
config.path_of('_img'),
config.path_of('_ant'),
config.path_of('_edt'),
config.path_of('_lym'),
config.path_of('_tl'),
config.path_of('_gsi'),
config.path_of('_pya')],
extra_link_args=config.link_args('laycore'),
extra_compile_args=config.compile_args('laycore'),
sources=list(lay_sources))
sources=config.sources("laycore"))
# ------------------------------------------------------------------
# pya extension library (all inclusive, basis of pya module)
pyacore_path = os.path.join("src", "pymod", "pya")
pyacore_sources = set(config.sources("pyacore", pyacore_path))
config.module("pyacore", os.path.join("src", "pymod", "pya"))
pya = Extension(config.root + '.pyacore',
define_macros=config.macros(),
include_dirs=[_laybasic_path,
_layview_path,
_lib_path,
_db_path,
_rdb_path,
_img_path,
_ant_path,
_edt_path,
_lym_path,
_tl_path,
_gsi_path,
_pya_path],
extra_objects=[config.path_of('_laybasic', _laybasic_path),
config.path_of('_layview', _layview_path),
config.path_of('_lib', _lib_path),
config.path_of('_db', _db_path),
config.path_of('_rdb', _rdb_path),
config.path_of('_img', _img_path),
config.path_of('_ant', _ant_path),
config.path_of('_edt', _edt_path),
config.path_of('_lym', _lym_path),
config.path_of('_tl', _tl_path),
config.path_of('_gsi', _gsi_path),
config.path_of('_pya', _pya_path)],
include_dirs=[config.src_path("_laybasic"),
config.src_path("_layview"),
config.src_path("_lib"),
config.src_path("_db"),
config.src_path("_rdb"),
config.src_path("_img"),
config.src_path("_ant"),
config.src_path("_edt"),
config.src_path("_lym"),
config.src_path("_tl"),
config.src_path("_gsi"),
config.src_path("_pya")],
extra_objects=[config.path_of('_laybasic'),
config.path_of('_layview'),
config.path_of('_lib'),
config.path_of('_db'),
config.path_of('_rdb'),
config.path_of('_img'),
config.path_of('_ant'),
config.path_of('_edt'),
config.path_of('_lym'),
config.path_of('_tl'),
config.path_of('_gsi'),
config.path_of('_pya')],
extra_link_args=config.link_args('pyacore'),
extra_compile_args=config.compile_args('pyacore'),
sources=list(pyacore_sources))
sources=config.sources("pyacore"))
# ------------------------------------------------------------------
# Core setup function