aboutsummaryrefslogtreecommitdiffhomepage
path: root/gyp
diff options
context:
space:
mode:
authorGravatar fmalita@google.com <fmalita@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-27 13:34:34 +0000
committerGravatar fmalita@google.com <fmalita@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-27 13:34:34 +0000
commitbacfcfb11cd0d869cc345795d5f3635aab7c50b6 (patch)
tree49136dffab7d816fe30674842746ddda3cff4885 /gyp
parentc6157be6c0ccd56d3eeb2601e6f1ca2fa403a543 (diff)
Generate debugger MOCs on the fly
Added gyp rules to generate Qt MOC files at build time, and removed the pre-packaged versions. Tested on Mac with Qt 4.6.4 & 4.8.3, and on Linux with Qt 4.8.1. R=caryclark@google.com,robertphillips@google.com,djsollen@google.com BUG= Review URL: https://codereview.appspot.com/6561054 git-svn-id: http://skia.googlecode.com/svn/trunk@5707 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gyp')
-rw-r--r--gyp/debugger.gyp182
1 files changed, 113 insertions, 69 deletions
diff --git a/gyp/debugger.gyp b/gyp/debugger.gyp
index 32afe7c302..5552ca1209 100644
--- a/gyp/debugger.gyp
+++ b/gyp/debugger.gyp
@@ -1,13 +1,86 @@
{
+ 'variables': {
+ 'conditions': [
+ [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
+ # Use the systemwide Qt libs by default
+ 'variables': {
+ 'qt_sdk%': '/usr',
+ },
+ 'qt_sdk': '<(qt_sdk)',
+ 'qt_moc%': 'moc',
+ 'qt_includes': [
+ '<(qt_sdk)/include',
+ '<(qt_sdk)/include/QtCore',
+ '<(qt_sdk)/include/QtGui',
+ '<(qt_sdk)/include/QtOpenGL',
+
+ # Systemwide Qt libs are not contained under a single tree,
+ # so we're adding package-qualified paths as a fallback.
+ '<(qt_sdk)/include/qt4',
+ '<(qt_sdk)/include/qt4/QtCore',
+ '<(qt_sdk)/include/qt4/QtGui',
+ '<(qt_sdk)/include/qt4/QtOpenGL',
+ ],
+ 'qt_libs': [
+ '-lQtCore',
+ '-lQtGui',
+ '-lQtOpenGL'
+ ],
+ }],
+ [ 'skia_os == "mac"', {
+ # Use the systemwide Qt libs by default
+ 'variables': {
+ 'qt_sdk%': '/Library/Frameworks',
+ },
+ 'qt_sdk': '<(qt_sdk)',
+ 'qt_moc%': 'moc',
+ 'qt_includes': [
+ '<(qt_sdk)/QtCore.framework/Headers/',
+ '<(qt_sdk)/QtGui.framework/Headers/',
+ '<(qt_sdk)/QtOpenGL.framework/Headers/',
+ ],
+ 'qt_libs': [
+ '<(qt_sdk)/QtCore.framework',
+ '<(qt_sdk)/QtGui.framework',
+ '<(qt_sdk)/QtOpenGL.framework',
+ ],
+ }],
+ [ 'skia_os == "win"', {
+ 'variables': {
+ # TODO: location of systemwide Qt on Win?
+ 'qt_sdk%': 'C:/Qt/4.6.4/',
+ },
+ 'qt_sdk': '<(qt_sdk)',
+ 'qt_moc%': '<(qt_sdk)/bin/moc',
+ 'qt_includes': [
+ '<(qt_sdk)/include',
+ '<(qt_sdk)/include/QtCore',
+ '<(qt_sdk)/include/QtGui',
+ '<(qt_sdk)/include/QtOpenGL',
+ ],
+ 'qt_libs': [
+ '<(qt_sdk)/lib/QtCore4.lib',
+ '<(qt_sdk)/lib/QtGui4.lib',
+ '<(qt_sdk)/lib/QtOpenGL.lib',
+ ],
+ }],
+ ],
+ 'moc_src_dir': '../debugger/QT',
+ },
'targets': [
{
'target_name': 'debugger',
'type': 'executable',
+ 'mac_bundle': 1,
+ 'mac_framework_dirs': [
+ '/Library/Frameworks',
+ ],
'include_dirs' : [
'../src/core',
- '../debugger', # To pull SkDebugger.h
- '../debugger/QT', # For all the QT UI Goodies
- '../src/gpu', # To pull gl/GrGLUtil.h
+ '../debugger', # To pull SkDebugger.h
+ '../debugger/QT', # For all the QT UI Goodies
+ '../src/gpu', # To pull gl/GrGLUtil.h
+ '<@(qt_includes)',
],
'sources': [
'../debugger/debuggermain.cpp',
@@ -16,12 +89,8 @@
'../debugger/SkDebugger.cpp',
'../debugger/SkDrawCommand.h',
'../debugger/SkDrawCommand.cpp',
- '../debugger/QT/moc_4.6.2_SkCanvasWidget.cpp',
- '../debugger/QT/moc_4.6.2_SkDebuggerGUI.cpp',
- '../debugger/QT/moc_4.6.2_SkInspectorWidget.cpp',
- '../debugger/QT/moc_4.6.2_SkSettingsWidget.cpp',
- '../debugger/QT/moc_4.6.2_SkRasterWidget.cpp',
- '../debugger/QT/moc_4.6.2_SkGLWidget.cpp',
+ '../debugger/SkObjectParser.h',
+ '../debugger/SkObjectParser.cpp',
'../debugger/QT/SkDebuggerGUI.cpp',
'../debugger/QT/SkDebuggerGUI.h',
'../debugger/QT/SkCanvasWidget.cpp',
@@ -30,8 +99,6 @@
'../debugger/QT/SkInspectorWidget.cpp',
'../debugger/QT/SkListWidget.h',
'../debugger/QT/SkListWidget.cpp',
- '../debugger/SkObjectParser.h',
- '../debugger/SkObjectParser.cpp',
'../debugger/QT/SkSettingsWidget.h',
'../debugger/QT/SkSettingsWidget.cpp',
'../debugger/QT/SkGLWidget.h',
@@ -41,6 +108,14 @@
# To update this file edit SkIcons.qrc and rerun rcc to generate cpp
'../debugger/QT/qrc_SkIcons.cpp',
+
+ # Generated MOC files
+ '<(moc_src_dir)/moc_SkCanvasWidget.cpp',
+ '<(moc_src_dir)/moc_SkDebuggerGUI.cpp',
+ '<(moc_src_dir)/moc_SkInspectorWidget.cpp',
+ '<(moc_src_dir)/moc_SkSettingsWidget.cpp',
+ '<(moc_src_dir)/moc_SkRasterWidget.cpp',
+ '<(moc_src_dir)/moc_SkGLWidget.cpp',
],
'dependencies': [
'core.gyp:core',
@@ -49,65 +124,34 @@
'effects.gyp:effects',
'gpu.gyp:gr',
'gpu.gyp:skgr',
+ 'debugger_mocs',
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '<@(qt_libs)',
+ ],
+ },
+ },
+ {
+ 'target_name': 'debugger_mocs',
+ 'type': 'none',
+ 'sources': [
+ '<(moc_src_dir)/SkCanvasWidget.h',
+ '<(moc_src_dir)/SkDebuggerGUI.h',
+ '<(moc_src_dir)/SkInspectorWidget.h',
+ '<(moc_src_dir)/SkSettingsWidget.h',
+ '<(moc_src_dir)/SkRasterWidget.h',
+ '<(moc_src_dir)/SkGLWidget.h',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'generate_moc',
+ 'extension': 'h',
+ 'outputs': [ '<(RULE_INPUT_DIRNAME)/moc_<(RULE_INPUT_ROOT).cpp' ],
+ 'action': [ '<(qt_moc)', '<(RULE_INPUT_PATH)', '-o', '<(moc_src_dir)/moc_<(RULE_INPUT_ROOT).cpp' ],
+ 'message': 'Generating <(RULE_INPUT_ROOT).cpp.',
+ },
],
- 'conditions': [
- [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
- 'include_dirs': [
- '/usr/include/qt4',
- '/usr/include/qt4/QtCore',
- '/usr/include/qt4/QtGui',
- '/usr/include/qt4/QtOpenGL',
- ],
- 'link_settings': {
- 'libraries' : [
- '-lQtCore',
- '-lQtGui',
- '-lQtOpenGL'
- ],
- },
- }],
- [ 'skia_os == "mac" and skia_arch_width != 64', {
-# this is now mysteriously triggered for all mac builds
-# 'error': '<!(skia_arch_width must be 64 bits when building the debugger on mac)'
- }],
- [ 'skia_os == "mac"', {
- 'mac_bundle' : 1,
- 'mac_framework_dirs': [
- '/Library/Frameworks',
- ],
- 'include_dirs': [
- '/Library/Frameworks/QtCore.framework/Headers/',
- '/Library/Frameworks/QtGui.framework/Headers/',
- '/Library/Frameworks/QtOpenGL.framework/Headers/',
- ],
- 'link_settings': {
- 'libraries': [
- '/Library/Frameworks/QtCore.framework',
- '/Library/Frameworks/QtGui.framework',
- '/Library/Frameworks/QtOpenGL.framework',
- ],
- },
- }],
- [ 'skia_os in ["ios"]', {
- 'error': '<!(debugger unsupported with skia_os=<(skia_os))'
- }],
- [ 'skia_os == "win"', {
- 'include_dirs': [
- # TODO(chudy): Dynamically generate these paths?
- 'C:/Qt/4.6.4/include',
- 'C:/Qt/4.6.4/include/QtCore',
- 'C:/Qt/4.6.4/include/QtGui',
- 'C:/Qt/4.6.4/include/QtOpenGL',
- ],
- 'link_settings': {
- 'libraries': [
- 'C:/Qt/4.6.4/lib/QtCore4.lib',
- 'C:/Qt/4.6.4/lib/QtGui4.lib',
- 'C:/Qt/4.6.4/lib/QtOpenGL.lib',
- ],
- },
- }],
- ]
},
],
}