WIP: debugging, enabled pymod builds ...

This commit is contained in:
Matthias Koefferlein 2022-05-15 18:45:07 +02:00
parent f0dcd59060
commit 856635bc82
15 changed files with 108 additions and 111 deletions

125
setup.py
View File

@ -524,21 +524,38 @@ _rdb = Library(config.root + '._rdb',
config.add_extension(_rdb) config.add_extension(_rdb)
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# _lay dependency library # _laybasic dependency library
_lay_path = os.path.join("src", "laybasic", "laybasic") _laybasic_path = os.path.join("src", "laybasic", "laybasic")
_lay_sources = set(glob.glob(os.path.join(_lay_path, "*.cc"))) _laybasic_sources = set(glob.glob(os.path.join(_laybasic_path, "*.cc")))
_lay = Library(config.root + '._lay', _laybasic = Library(config.root + '._laybasic',
define_macros=config.macros() + [('MAKE_LAYBASIC_LIBRARY', 1)], define_macros=config.macros() + [('MAKE_LAYBASIC_LIBRARY', 1)],
include_dirs=[_rdb_path, _db_path, _tl_path, _gsi_path], include_dirs=[_rdb_path, _db_path, _tl_path, _gsi_path],
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)], 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)],
language='c++', language='c++',
libraries=config.libraries('_lay'), libraries=config.libraries('_laybasic'),
extra_link_args=config.link_args('_lay'), extra_link_args=config.link_args('_laybasic'),
extra_compile_args=config.compile_args('_lay'), extra_compile_args=config.compile_args('_laybasic'),
sources=list(_lay_sources)) sources=list(_laybasic_sources))
config.add_extension(_lay) config.add_extension(_laybasic)
# ------------------------------------------------------------------
# _layview dependency library
_layview_path = os.path.join("src", "layview", "layview")
_layview_sources = set(glob.glob(os.path.join(_layview_path, "*.cc")))
_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],
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)],
language='c++',
libraries=config.libraries('_layview'),
extra_link_args=config.link_args('_layview'),
extra_compile_args=config.compile_args('_layview'),
sources=list(_layview_sources))
config.add_extension(_layview)
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# _lym dependency library # _lym dependency library
@ -565,8 +582,8 @@ _ant_sources = set(glob.glob(os.path.join(_ant_path, "*.cc")))
_ant = Library(config.root + '._ant', _ant = Library(config.root + '._ant',
define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)], define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)],
include_dirs=[_lay_path, _rdb_path, _db_path, _tl_path, _gsi_path], include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path],
extra_objects=[config.path_of('_lay', _lay_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)], 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)],
language='c++', language='c++',
libraries=config.libraries('_ant'), libraries=config.libraries('_ant'),
extra_link_args=config.link_args('_ant'), extra_link_args=config.link_args('_ant'),
@ -582,8 +599,8 @@ _img_sources = set(glob.glob(os.path.join(_img_path, "*.cc")))
_img = Library(config.root + '._img', _img = Library(config.root + '._img',
define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)], define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)],
include_dirs=[_lay_path, _rdb_path, _db_path, _tl_path, _gsi_path], include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path],
extra_objects=[config.path_of('_lay', _lay_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)], 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)],
language='c++', language='c++',
libraries=config.libraries('_img'), libraries=config.libraries('_img'),
extra_link_args=config.link_args('_img'), extra_link_args=config.link_args('_img'),
@ -599,8 +616,8 @@ _edt_sources = set(glob.glob(os.path.join(_edt_path, "*.cc")))
_edt = Library(config.root + '._edt', _edt = Library(config.root + '._edt',
define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)], define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)],
include_dirs=[_lay_path, _rdb_path, _db_path, _tl_path, _gsi_path], include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path],
extra_objects=[config.path_of('_lay', _lay_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)], 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)],
language='c++', language='c++',
libraries=config.libraries('_edt'), libraries=config.libraries('_edt'),
extra_link_args=config.link_args('_edt'), extra_link_args=config.link_args('_edt'),
@ -699,68 +716,28 @@ lay_sources = set(glob.glob(os.path.join(lay_path, "*.cc")))
lay = Extension(config.root + '.laycore', lay = Extension(config.root + '.laycore',
define_macros=config.macros(), define_macros=config.macros(),
include_dirs=[_lay_path, _img_path, _ant_path, _edt_path, _lym_path, _tl_path, _gsi_path, _pya_path], include_dirs=[_laybasic_path,
extra_objects=[config.path_of('_lay', _lay_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)], _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)],
extra_link_args=config.link_args('laycore'), extra_link_args=config.link_args('laycore'),
extra_compile_args=config.compile_args('laycore'), extra_compile_args=config.compile_args('laycore'),
sources=list(lay_sources)) sources=list(lay_sources))
# ------------------------------------------------------------------
# ant extension library
ant_path = os.path.join("src", "pymod", "ant")
ant_sources = set(glob.glob(os.path.join(ant_path, "*.cc")))
ant = Extension(config.root + '.antcore',
define_macros=config.macros(),
include_dirs=[_ant_path, _tl_path, _gsi_path, _pya_path],
extra_objects=[config.path_of('_ant', _ant_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)],
extra_link_args=config.link_args('antcore'),
extra_compile_args=config.compile_args('antcore'),
sources=list(ant_sources))
# ------------------------------------------------------------------
# edt extension library
edt_path = os.path.join("src", "pymod", "edt")
edt_sources = set(glob.glob(os.path.join(edt_path, "*.cc")))
edt = Extension(config.root + '.edtcore',
define_macros=config.macros(),
include_dirs=[_edt_path, _tl_path, _gsi_path, _pya_path],
extra_objects=[config.path_of('_edt', _edt_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)],
extra_link_args=config.link_args('edtcore'),
extra_compile_args=config.compile_args('edtcore'),
sources=list(edt_sources))
# ------------------------------------------------------------------
# img extension library
img_path = os.path.join("src", "pymod", "img")
img_sources = set(glob.glob(os.path.join(img_path, "*.cc")))
img = Extension(config.root + '.imgcore',
define_macros=config.macros(),
include_dirs=[_img_path, _tl_path, _gsi_path, _pya_path],
extra_objects=[config.path_of('_img', _img_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)],
extra_link_args=config.link_args('imgcore'),
extra_compile_args=config.compile_args('imgcore'),
sources=list(img_sources))
# ------------------------------------------------------------------
# lym extension library
lym_path = os.path.join("src", "pymod", "lym")
lym_sources = set(glob.glob(os.path.join(lym_path, "*.cc")))
lym = Extension(config.root + '.lymcore',
define_macros=config.macros(),
include_dirs=[_lym_path, _tl_path, _gsi_path, _pya_path],
extra_objects=[config.path_of('_lym', _lym_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)],
extra_link_args=config.link_args('lymcore'),
extra_compile_args=config.compile_args('lymcore'),
sources=list(lym_sources))
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# Core setup function # Core setup function
@ -786,4 +763,4 @@ if __name__ == '__main__':
url='https://github.com/klayout/klayout', url='https://github.com/klayout/klayout',
packages=find_packages('src/pymod/distutils_src'), packages=find_packages('src/pymod/distutils_src'),
package_dir={'': 'src/pymod/distutils_src'}, # https://github.com/pypa/setuptools/issues/230 package_dir={'': 'src/pymod/distutils_src'}, # https://github.com/pypa/setuptools/issues/230
ext_modules=[_tl, _gsi, _pya, _rba, _db, _lib, _rdb, _lym, _lay, _ant, _edt, _img] + db_plugins + [tl, db, lib, rdb, lay, ant, edt, img, lym]) ext_modules=[_tl, _gsi, _pya, _rba, _db, _lib, _rdb, _lym, _laybasic, _layview, _ant, _edt, _img] + db_plugins + [tl, db, lib, rdb, lay])

View File

@ -1546,34 +1546,6 @@ LAYBASIC_PUBLIC Class<lay::LayoutViewBase> decl_LayoutViewBase (QT_EXTERNAL_BASE
"Returns an array of \\LayerPropertiesIterator objects pointing to the currently selected layers. " "Returns an array of \\LayerPropertiesIterator objects pointing to the currently selected layers. "
"If no layer view is selected currently, an empty array is returned.\n" "If no layer view is selected currently, an empty array is returned.\n"
) + ) +
#if !defined(HAVE_QT)
gsi::event ("on_image_updated_event", static_cast<tl::Event (lay::LayoutViewBase::*)> (&lay::LayoutViewBase::image_updated_event),
"@brief An event indicating that the image (\"screenshot\") was updated\n"
"\n"
"This event is triggered when calling \\timer."
"\n"
"This event has been introduced in version 0.28."
) +
gsi::event ("on_drawing_finished_event", static_cast<tl::Event (lay::LayoutViewBase::*)> (&lay::LayoutViewBase::drawing_finished_event),
"@brief An event indicating that the image is fully drawn\n"
"\n"
"This event is triggered when calling \\timer. "
"Before this event is issue, a final \\on_image_updated_event may be issued.\n"
"\n"
"This event has been introduced in version 0.28."
) +
gsi::method ("timer", static_cast<void (lay::LayoutViewBase::*) ()> (&lay::LayoutViewBase::timer),
"@brief A callback required to be called regularily in the non-Qt case.\n"
"\n"
"This callback eventually implements the event loop in the non-Qt case. The main task "
"is to indicate new versions of the layout image while it is drawn. "
"When a new image has arrived, this method will issue an \\on_image_updated_event. "
"In the implementation of the latter, \"screenshot\" may be called to retrieve the current image.\n"
"When drawing has finished, the \\on_drawing_finished_event will be triggered.\n"
"\n"
"This method has been introduced in version 0.28."
) +
#endif
gsi::event ("on_active_cellview_changed", static_cast<tl::Event (lay::LayoutViewBase::*)> (&lay::LayoutViewBase::active_cellview_changed_event), gsi::event ("on_active_cellview_changed", static_cast<tl::Event (lay::LayoutViewBase::*)> (&lay::LayoutViewBase::active_cellview_changed_event),
"@brief An event indicating that the active cellview has changed\n" "@brief An event indicating that the active cellview has changed\n"
"\n" "\n"

View File

@ -23,7 +23,6 @@ FORMS = \
DuplicateLayerDialog.ui \ DuplicateLayerDialog.ui \
EditStipplesForm.ui \ EditStipplesForm.ui \
FlattenInstOptionsDialog.ui \ FlattenInstOptionsDialog.ui \
GridNetConfigPage.ui \
LayerMappingWidget.ui \ LayerMappingWidget.ui \
LayerSourceDialog.ui \ LayerSourceDialog.ui \
LayoutProperties.ui \ LayoutProperties.ui \
@ -105,8 +104,6 @@ SOURCES = \
layEditorOptionsPage.cc \ layEditorOptionsPage.cc \
layEditorOptionsPages.cc \ layEditorOptionsPages.cc \
layFileDialog.cc \ layFileDialog.cc \
layGridNetConfigPage.cc \
layGridNet.cc \
layGenericSyntaxHighlighter.cc \ layGenericSyntaxHighlighter.cc \
layHierarchyControlPanel.cc \ layHierarchyControlPanel.cc \
layIndexedNetlistModel.cc \ layIndexedNetlistModel.cc \
@ -165,8 +162,6 @@ HEADERS = \
layEditorOptionsPages.h \ layEditorOptionsPages.h \
layFileDialog.h \ layFileDialog.h \
layGenericSyntaxHighlighter.h \ layGenericSyntaxHighlighter.h \
layGridNetConfigPage.h \
layGridNet.h \
layHierarchyControlPanel.h \ layHierarchyControlPanel.h \
layIndexedNetlistModel.h \ layIndexedNetlistModel.h \
layItemDelegates.h \ layItemDelegates.h \
@ -196,7 +191,6 @@ HEADERS = \
layTechnology.h \ layTechnology.h \
layTipDialog.h \ layTipDialog.h \
layWidgets.h \ layWidgets.h \
laybasicConfig.h \
rdbInfoWidget.h \ rdbInfoWidget.h \
rdbMarkerBrowser.h \ rdbMarkerBrowser.h \
rdbMarkerBrowserDialog.h \ rdbMarkerBrowserDialog.h \

View File

@ -20,7 +20,10 @@
*/ */
#if !defined(HAVE_QT)
#include "gsiDecl.h" #include "gsiDecl.h"
#include "gsiSignals.h"
#include "layLayoutView.h" #include "layLayoutView.h"
namespace gsi namespace gsi
@ -46,6 +49,32 @@ Class<lay::LayoutView> decl_LayoutView (decl_LayoutViewBase, "lay", "LayoutView"
"\n" "\n"
"This constructor has been introduced in version 0.25.\n" "This constructor has been introduced in version 0.25.\n"
"It has been enhanced with the arguments in version 0.27.\n" "It has been enhanced with the arguments in version 0.27.\n"
) +
gsi::event ("on_image_updated_event", static_cast<tl::Event (lay::LayoutView::*)> (&lay::LayoutView::image_updated_event),
"@brief An event indicating that the image (\"screenshot\") was updated\n"
"\n"
"This event is triggered when calling \\timer."
"\n"
"This event has been introduced in version 0.28."
) +
gsi::event ("on_drawing_finished_event", static_cast<tl::Event (lay::LayoutView::*)> (&lay::LayoutView::drawing_finished_event),
"@brief An event indicating that the image is fully drawn\n"
"\n"
"This event is triggered when calling \\timer. "
"Before this event is issue, a final \\on_image_updated_event may be issued.\n"
"\n"
"This event has been introduced in version 0.28."
) +
gsi::method ("timer", static_cast<void (lay::LayoutView::*) ()> (&lay::LayoutView::timer),
"@brief A callback required to be called regularily in the non-Qt case.\n"
"\n"
"This callback eventually implements the event loop in the non-Qt case. The main task "
"is to indicate new versions of the layout image while it is drawn. "
"When a new image has arrived, this method will issue an \\on_image_updated_event. "
"In the implementation of the latter, \"screenshot\" may be called to retrieve the current image.\n"
"When drawing has finished, the \\on_drawing_finished_event will be triggered.\n"
"\n"
"This method has been introduced in version 0.28."
), ),
"@brief The view object presenting one or more layout objects\n" "@brief The view object presenting one or more layout objects\n"
"\n" "\n"
@ -82,3 +111,5 @@ static ClassExt<lay::LayerPropertiesNode> extdecl_LayerPropertiesNode (
} }
#endif

View File

@ -20,6 +20,7 @@
*/ */
#if defined(HAVE_QT)
#include "gsiDecl.h" #include "gsiDecl.h"
#include "gsiSignals.h" #include "gsiSignals.h"
@ -221,3 +222,5 @@ static ClassExt<lay::LayerPropertiesNode> extdecl_LayerPropertiesNode (
); );
} }
#endif

View File

@ -20,6 +20,8 @@
*/ */
#if !defined(HAVE_QT)
#include "layLayoutView.h" #include "layLayoutView.h"
namespace lay namespace lay
@ -58,3 +60,5 @@ LayoutView::timer ()
} }
} // namespace lay } // namespace lay
#endif

View File

@ -20,6 +20,7 @@
*/ */
#if !defined(HAVE_QT)
#ifndef HDR_layLayoutViewNoQt #ifndef HDR_layLayoutViewNoQt
#define HDR_layLayoutViewNoQt #define HDR_layLayoutViewNoQt
@ -78,3 +79,5 @@ private:
} }
#endif #endif
#endif

View File

@ -20,6 +20,8 @@
*/ */
#if defined(HAVE_QT)
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <vector> #include <vector>
@ -1083,3 +1085,6 @@ LayoutView::sizeHint () const
} }
} // namespace lay } // namespace lay
#endif

View File

@ -20,6 +20,7 @@
*/ */
#if defined(HAVE_QT)
#ifndef HDR_layLayoutViewQt #ifndef HDR_layLayoutViewQt
#define HDR_layLayoutViewQt #define HDR_layLayoutViewQt
@ -738,3 +739,5 @@ private:
} }
#endif #endif
#endif

View File

@ -6,22 +6,27 @@ include($$PWD/../../lib.pri)
DEFINES += MAKE_LAYVIEW_LIBRARY DEFINES += MAKE_LAYVIEW_LIBRARY
FORMS = \
RESOURCES = \ RESOURCES = \
SOURCES = \ SOURCES = \
layGridNet.cc \
HEADERS = \ HEADERS = \
layLayoutView.h layGridNet.h \
layLayoutView.h \
!equals(HAVE_QT, "0") { !equals(HAVE_QT, "0") {
FORMS = \
GridNetConfigPage.ui \
SOURCES += \ SOURCES += \
layGridNetConfigPage.cc \
layLayoutView_qt.cc \ layLayoutView_qt.cc \
gsiDeclLayLayoutView_qt.cc \ gsiDeclLayLayoutView_qt.cc \
HEADERS += \ HEADERS += \
layGridNetConfigPage.h \
layLayoutView_qt.h \ layLayoutView_qt.h \
} else { } else {