working shared setup
This commit is contained in:
parent
d6b96fc235
commit
62362c7fe8
35
binding.gyp
35
binding.gyp
@ -1,14 +1,25 @@
|
||||
{
|
||||
"includes": [
|
||||
"./config/application.gypi",
|
||||
"./config/common.gypi",
|
||||
"./config/qt.gypi",
|
||||
"./config/deps.gypi",
|
||||
"./config/moc.gypi",
|
||||
],
|
||||
"targets": [{
|
||||
"target_name": "qtnode",
|
||||
# 'type': 'shared_library',
|
||||
'include_dirs': ['.']
|
||||
}]
|
||||
"includes": [],
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "qtnode",
|
||||
'include_dirs': ['.', './deps/'],
|
||||
"includes": [
|
||||
"./config/application.gypi",
|
||||
"./config/moc.gypi",
|
||||
"./config/common.gypi",
|
||||
"./config/qt.gypi",
|
||||
],
|
||||
'dependencies': [
|
||||
'./config/deps.gypi:nodeguidep',
|
||||
],
|
||||
'conditions':[
|
||||
['OS=="mac"', {
|
||||
'xcode_settings': {
|
||||
'OTHER_LDFLAGS': ['-Wl,-rpath,@loader_path'],
|
||||
},
|
||||
}]
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,30 +1,28 @@
|
||||
{
|
||||
"target_defaults": {
|
||||
"sources": [
|
||||
"../src/cpp/main.cpp",
|
||||
# non-wrapped cpps
|
||||
"../src/cpp/Extras/Utils/nutils.cpp",
|
||||
"../src/cpp/core/FlexLayout/flexlayout.cpp",
|
||||
"../src/cpp/core/FlexLayout/flexitem.cpp",
|
||||
"../src/cpp/core/YogaWidget/nodestyle.cpp",
|
||||
"../src/cpp/core/Events/eventsmap.cpp",
|
||||
"../src/cpp/core/Events/eventwidget.cpp",
|
||||
"../src/cpp/core/YogaWidget/yogawidget.cpp",
|
||||
# wrapped cpps
|
||||
"../src/cpp/QtGui/QApplication/qapplication_wrap.cpp",
|
||||
"../src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp",
|
||||
"../src/cpp/QtGui/QPixmap/qpixmap_wrap.cpp",
|
||||
'../src/cpp/core/FlexLayout/flexlayout_wrap.cpp',
|
||||
"../src/cpp/QtWidgets/QWidget/qwidget_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QGridLayout/qgridlayout_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QLabel/qlabel_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QLayout/qlayout_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QMainWindow/qmainwindow_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QPushButton/qpushbutton_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QCheckBox/qcheckbox_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QProgressBar/qprogressbar_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QRadioButton/qradiobutton_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QLineEdit/qlineedit_wrap.cpp",
|
||||
],
|
||||
}
|
||||
"sources": [
|
||||
"../src/cpp/main.cpp",
|
||||
# non wrapped
|
||||
"../src/cpp/Extras/Utils/nutils.cpp",
|
||||
"../src/cpp/core/FlexLayout/flexlayout.cpp",
|
||||
"../src/cpp/core/FlexLayout/flexitem.cpp",
|
||||
"../src/cpp/core/YogaWidget/nodestyle.cpp",
|
||||
"../src/cpp/core/Events/eventsmap.cpp",
|
||||
"../src/cpp/core/Events/eventwidget.cpp",
|
||||
"../src/cpp/core/YogaWidget/yogawidget.cpp",
|
||||
# wrapped cpps. Move non wrapped ones to shared gypi
|
||||
"../src/cpp/QtGui/QApplication/qapplication_wrap.cpp",
|
||||
"../src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp",
|
||||
"../src/cpp/QtGui/QPixmap/qpixmap_wrap.cpp",
|
||||
'../src/cpp/core/FlexLayout/flexlayout_wrap.cpp',
|
||||
"../src/cpp/QtWidgets/QWidget/qwidget_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QGridLayout/qgridlayout_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QLabel/qlabel_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QLayout/qlayout_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QMainWindow/qmainwindow_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QPushButton/qpushbutton_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QCheckBox/qcheckbox_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QProgressBar/qprogressbar_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QRadioButton/qradiobutton_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QLineEdit/qlineedit_wrap.cpp",
|
||||
],
|
||||
}
|
||||
|
||||
@ -1,47 +1,47 @@
|
||||
{
|
||||
'target_defaults': {
|
||||
'cflags!': ['-fno-exceptions'],
|
||||
'cflags_cc!': ['-fno-exceptions'],
|
||||
'sources': [],
|
||||
'includes': [],
|
||||
'include_dirs': [
|
||||
"<!@(node -p \"require('node-addon-api').include\")",
|
||||
],
|
||||
'dependencies': [
|
||||
"<!(node -p \"require('node-addon-api').gyp\")",
|
||||
],
|
||||
'defines': ['NAPI_CPP_EXCEPTIONS'],
|
||||
'target_conditions': [
|
||||
['OS=="mac"', {
|
||||
'cflags+': ['-fvisibility=hidden'],
|
||||
'xcode_settings': {
|
||||
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
|
||||
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
|
||||
'CLANG_CXX_LIBRARY': 'libc++',
|
||||
'MACOSX_DEPLOYMENT_TARGET': '10.7',
|
||||
'OTHER_CFLAGS': ['-std=c++14'],
|
||||
'cflags!': ['-fno-exceptions'],
|
||||
'cflags_cc!': ['-fno-exceptions'],
|
||||
'sources': [],
|
||||
'includes': [],
|
||||
'include_dirs': [
|
||||
"<!@(node -p \"require('node-addon-api').include\")",
|
||||
'..',
|
||||
'../deps/',
|
||||
],
|
||||
'dependencies': [
|
||||
"<!(node -p \"require('node-addon-api').gyp\")",
|
||||
],
|
||||
'defines': ['NAPI_CPP_EXCEPTIONS'],
|
||||
'target_conditions': [
|
||||
['OS=="mac"', {
|
||||
'cflags+': ['-fvisibility=hidden'],
|
||||
'xcode_settings': {
|
||||
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
|
||||
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
|
||||
'CLANG_CXX_LIBRARY': 'libc++',
|
||||
'MACOSX_DEPLOYMENT_TARGET': '10.7',
|
||||
'OTHER_CFLAGS': ['-std=c++14'],
|
||||
},
|
||||
}],
|
||||
['OS=="linux"', {
|
||||
'cflags': [
|
||||
'-fPIC'
|
||||
],
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'ExceptionHandling': 1,
|
||||
'AdditionalOptions': [
|
||||
'/GR-',
|
||||
'/MT',
|
||||
'/EHsc'
|
||||
]
|
||||
},
|
||||
}],
|
||||
['OS=="linux"', {
|
||||
'cflags': [
|
||||
'-fPIC'
|
||||
],
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'ExceptionHandling': 1,
|
||||
'AdditionalOptions': [
|
||||
'/GR-',
|
||||
'/MT',
|
||||
'/EHsc'
|
||||
]
|
||||
},
|
||||
},
|
||||
"defines": [
|
||||
"_HAS_EXCEPTIONS=1",
|
||||
],
|
||||
}],
|
||||
],
|
||||
},
|
||||
},
|
||||
"defines": [
|
||||
"_HAS_EXCEPTIONS=1",
|
||||
],
|
||||
}],
|
||||
],
|
||||
}
|
||||
|
||||
@ -1,29 +1,33 @@
|
||||
{
|
||||
"target_defaults": {
|
||||
"include_dirs": ['../deps/'],
|
||||
"sources": [
|
||||
"../deps/yoga/log.cpp",
|
||||
"../deps/yoga/Utils.cpp",
|
||||
"../deps/yoga/YGConfig.cpp",
|
||||
"../deps/yoga/YGEnums.cpp",
|
||||
"../deps/yoga/YGLayout.cpp",
|
||||
"../deps/yoga/YGNode.cpp",
|
||||
"../deps/yoga/YGNodePrint.cpp",
|
||||
"../deps/yoga/YGStyle.cpp",
|
||||
"../deps/yoga/YGValue.cpp",
|
||||
"../deps/yoga/Yoga.cpp",
|
||||
"../deps/yoga/event/event.cpp",
|
||||
"../deps/yoga/internal/experiments.cpp"
|
||||
],
|
||||
'defines': [
|
||||
'SPDLOG_COMPILED_LIB'
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
'defines': [
|
||||
'ENUM_BITFIELDS_NOT_SUPPORTED', # Needed for yoga to work nicely on windows
|
||||
],
|
||||
}]
|
||||
],
|
||||
}
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "nodeguidep",
|
||||
'type': 'shared_library',
|
||||
"include_dirs": ['../deps/'],
|
||||
"sources": [
|
||||
"../deps/yoga/log.cpp",
|
||||
"../deps/yoga/Utils.cpp",
|
||||
"../deps/yoga/YGConfig.cpp",
|
||||
"../deps/yoga/YGEnums.cpp",
|
||||
"../deps/yoga/YGLayout.cpp",
|
||||
"../deps/yoga/YGNode.cpp",
|
||||
"../deps/yoga/YGNodePrint.cpp",
|
||||
"../deps/yoga/YGStyle.cpp",
|
||||
"../deps/yoga/YGValue.cpp",
|
||||
"../deps/yoga/Yoga.cpp",
|
||||
"../deps/yoga/event/event.cpp",
|
||||
"../deps/yoga/internal/experiments.cpp",
|
||||
],
|
||||
'defines': [
|
||||
'SPDLOG_COMPILED_LIB'
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
'defines': [
|
||||
'ENUM_BITFIELDS_NOT_SUPPORTED', # Needed for yoga to work nicely on windows
|
||||
],
|
||||
}]
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,16 +1,14 @@
|
||||
# AUTOGENERATED FILE. DO NOT MODIFY . ALL CHANGES WILL BE LOST
|
||||
# RUN: npm run automoc after updating moc.json
|
||||
{
|
||||
"target_defaults": {
|
||||
"sources": [
|
||||
"../src/cpp/autogen/nwidget_moc.cpp",
|
||||
"../src/cpp/autogen/nlabel_moc.cpp",
|
||||
"../src/cpp/autogen/ncheckbox_moc.cpp",
|
||||
"../src/cpp/autogen/nlineedit_moc.cpp",
|
||||
"../src/cpp/autogen/nmainwindow_moc.cpp",
|
||||
"../src/cpp/autogen/nprogressbar_moc.cpp",
|
||||
"../src/cpp/autogen/npushbutton_moc.cpp",
|
||||
"../src/cpp/autogen/nradiobutton_moc.cpp"
|
||||
]
|
||||
}
|
||||
}
|
||||
"sources": [
|
||||
"../src/cpp/autogen/nwidget_moc.cpp",
|
||||
"../src/cpp/autogen/nlabel_moc.cpp",
|
||||
"../src/cpp/autogen/ncheckbox_moc.cpp",
|
||||
"../src/cpp/autogen/nlineedit_moc.cpp",
|
||||
"../src/cpp/autogen/nmainwindow_moc.cpp",
|
||||
"../src/cpp/autogen/nprogressbar_moc.cpp",
|
||||
"../src/cpp/autogen/npushbutton_moc.cpp",
|
||||
"../src/cpp/autogen/nradiobutton_moc.cpp"
|
||||
]
|
||||
}
|
||||
|
||||
120
config/qt.gypi
120
config/qt.gypi
@ -1,66 +1,64 @@
|
||||
{
|
||||
"target_defaults": {
|
||||
'variables': {
|
||||
'qt_home_dir%': "<!(node -p \"require('@nodegui/qode').qtHome\")",
|
||||
},
|
||||
'target_conditions': [
|
||||
['OS=="mac"', {
|
||||
'actions': [
|
||||
{
|
||||
'action_name': 'symlink_qt_headers',
|
||||
'inputs': [],
|
||||
'outputs': [
|
||||
'<(qt_home_dir)/include/QtCore',
|
||||
'<(qt_home_dir)/include/QtGui',
|
||||
'<(qt_home_dir)/include/QtWidgets',
|
||||
],
|
||||
'action': [
|
||||
'sh', '-c',
|
||||
'mkdir -p <(qt_home_dir)/include && \
|
||||
'variables': {
|
||||
'qt_home_dir%': "<!(node -p \"require('@nodegui/qode').qtHome\")",
|
||||
},
|
||||
'target_conditions': [
|
||||
['OS=="mac"', {
|
||||
'actions': [
|
||||
{
|
||||
'action_name': 'symlink_qt_headers',
|
||||
'inputs': [],
|
||||
'outputs': [
|
||||
'<(qt_home_dir)/include/QtCore',
|
||||
'<(qt_home_dir)/include/QtGui',
|
||||
'<(qt_home_dir)/include/QtWidgets',
|
||||
],
|
||||
'action': [
|
||||
'sh', '-c',
|
||||
'mkdir -p <(qt_home_dir)/include && \
|
||||
ln -sfn <(qt_home_dir)/lib/QtCore.framework/Versions/5/Headers <(qt_home_dir)/include/QtCore && \
|
||||
ln -sfn <(qt_home_dir)/lib/QtGui.framework/Versions/5/Headers <(qt_home_dir)/include/QtGui && \
|
||||
ln -sfn <(qt_home_dir)/lib/QtWidgets.framework/Versions/5/Headers <(qt_home_dir)/include/QtWidgets'
|
||||
],
|
||||
}
|
||||
],
|
||||
'include_dirs': [
|
||||
'<(qt_home_dir)/include',
|
||||
'<(qt_home_dir)/lib/QtCore.framework/Versions/5/Headers',
|
||||
'<(qt_home_dir)/lib/QtGui.framework/Versions/5/Headers',
|
||||
'<(qt_home_dir)/lib/QtWidgets.framework/Versions/5/Headers',
|
||||
],
|
||||
'libraries': [
|
||||
'<(qt_home_dir)/lib/QtCore.framework/Versions/5/QtCore',
|
||||
'<(qt_home_dir)/lib/QtGui.framework/Versions/5/QtGui',
|
||||
'<(qt_home_dir)/lib/QtWidgets.framework/Versions/5/QtWidgets',
|
||||
],
|
||||
}],
|
||||
['OS=="linux"', {
|
||||
'include_dirs': [
|
||||
'<(qt_home_dir)/include',
|
||||
'<(qt_home_dir)/include/QtCore',
|
||||
'<(qt_home_dir)/include/QtGui',
|
||||
'<(qt_home_dir)/include/QtWidgets',
|
||||
],
|
||||
'libraries': [
|
||||
'<(qt_home_dir)/lib/libQt5Core.so',
|
||||
'<(qt_home_dir)/lib/libQt5Gui.so',
|
||||
'<(qt_home_dir)/lib/libQt5Widgets.so',
|
||||
],
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'include_dirs': [
|
||||
'<(qt_home_dir)\\include',
|
||||
'<(qt_home_dir)\\include\\QtCore',
|
||||
'<(qt_home_dir)\\include\\QtGui',
|
||||
'<(qt_home_dir)\\include\\QtWidgets',
|
||||
],
|
||||
'libraries': [
|
||||
'<(qt_home_dir)\\lib\\Qt5Core.lib',
|
||||
'<(qt_home_dir)\\lib\\Qt5Gui.lib',
|
||||
'<(qt_home_dir)\\lib\\Qt5Widgets.lib',
|
||||
]
|
||||
}],
|
||||
],
|
||||
}
|
||||
],
|
||||
}
|
||||
],
|
||||
'include_dirs': [
|
||||
'<(qt_home_dir)/include',
|
||||
'<(qt_home_dir)/lib/QtCore.framework/Versions/5/Headers',
|
||||
'<(qt_home_dir)/lib/QtGui.framework/Versions/5/Headers',
|
||||
'<(qt_home_dir)/lib/QtWidgets.framework/Versions/5/Headers',
|
||||
],
|
||||
'libraries': [
|
||||
'<(qt_home_dir)/lib/QtCore.framework/Versions/5/QtCore',
|
||||
'<(qt_home_dir)/lib/QtGui.framework/Versions/5/QtGui',
|
||||
'<(qt_home_dir)/lib/QtWidgets.framework/Versions/5/QtWidgets',
|
||||
],
|
||||
}],
|
||||
['OS=="linux"', {
|
||||
'include_dirs': [
|
||||
'<(qt_home_dir)/include',
|
||||
'<(qt_home_dir)/include/QtCore',
|
||||
'<(qt_home_dir)/include/QtGui',
|
||||
'<(qt_home_dir)/include/QtWidgets',
|
||||
],
|
||||
'libraries': [
|
||||
'<(qt_home_dir)/lib/libQt5Core.so',
|
||||
'<(qt_home_dir)/lib/libQt5Gui.so',
|
||||
'<(qt_home_dir)/lib/libQt5Widgets.so',
|
||||
],
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'include_dirs': [
|
||||
'<(qt_home_dir)\\include',
|
||||
'<(qt_home_dir)\\include\\QtCore',
|
||||
'<(qt_home_dir)\\include\\QtGui',
|
||||
'<(qt_home_dir)\\include\\QtWidgets',
|
||||
],
|
||||
'libraries': [
|
||||
'<(qt_home_dir)\\lib\\Qt5Core.lib',
|
||||
'<(qt_home_dir)\\lib\\Qt5Gui.lib',
|
||||
'<(qt_home_dir)\\lib\\Qt5Widgets.lib',
|
||||
]
|
||||
}],
|
||||
],
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user