1# Copyright 2015 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5{
6  'variables': {
7    'skia_warnings_as_errors': 0,
8    'conditions': [
9      [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]', {
10        # Use the systemwide Qt libs by default
11        'variables': {
12          'qt_sdk%': '/usr',
13        },
14        'qt_sdk': '<(qt_sdk)',
15        'qt_moc%': 'moc',
16        'qt_includes': [
17          '<(qt_sdk)/include',
18          '<(qt_sdk)/include/QtCore',
19          '<(qt_sdk)/include/QtGui',
20          '<(qt_sdk)/include/QtOpenGL',
21
22          # Systemwide Qt libs are not contained under a single tree,
23          # so we're adding package-qualified paths as a fallback.
24          '<(qt_sdk)/include/qt4',
25          '<(qt_sdk)/include/qt4/QtCore',
26          '<(qt_sdk)/include/qt4/QtGui',
27          '<(qt_sdk)/include/qt4/QtOpenGL',
28        ],
29        'qt_libs': [
30          '-lQtCore',
31          '-lQtGui',
32          '-lQtOpenGL'
33        ],
34      }],
35      [ 'skia_os == "mac"', {
36        # Use the systemwide Qt libs by default
37        'variables': {
38          'qt_sdk%': '/Library/Frameworks',
39        },
40        'qt_sdk': '<(qt_sdk)',
41        'qt_moc%': 'moc',
42        'qt_includes': [
43          '<(qt_sdk)/QtCore.framework/Headers/',
44          '<(qt_sdk)/QtGui.framework/Headers/',
45          '<(qt_sdk)/QtOpenGL.framework/Headers/',
46        ],
47        'qt_libs': [
48          '<(qt_sdk)/QtCore.framework',
49          '<(qt_sdk)/QtGui.framework',
50          '<(qt_sdk)/QtOpenGL.framework',
51        ],
52      }],
53      [ 'skia_os == "win"', {
54        'variables': {
55          # This is the default location for the version of Qt current on 10/11/12
56          'qt_sdk%': 'C:/Qt/4.8.3/',
57        },
58        'qt_sdk': '<(qt_sdk)',
59        'qt_moc%': '<(qt_sdk)/bin/moc',
60        'qt_includes': [
61          '<(qt_sdk)/include',
62          '<(qt_sdk)/include/QtCore',
63          '<(qt_sdk)/include/QtGui',
64          '<(qt_sdk)/include/QtOpenGL',
65        ],
66        'qt_libs': [
67          '<(qt_sdk)/lib/QtCore4.lib',
68          '<(qt_sdk)/lib/QtGui4.lib',
69          '<(qt_sdk)/lib/QtOpenGL4.lib',
70        ],
71      }],
72    ],
73    'moc_src_dir': '../debugger/QT',
74    'moc_gen_dir': '<(SHARED_INTERMEDIATE_DIR)/debugger/QT',
75  },
76  'targets': [
77    {
78      'target_name': 'debugger',
79      'type': 'executable',
80      'mac_bundle': 1,
81      'mac_framework_dirs': [
82        '/Library/Frameworks',
83      ],
84      'include_dirs' : [
85        '../src/core',
86        '../src/utils/debugger',
87        '../debugger',      # To pull SkDebugger.h
88        '../src/gpu',       # To pull gl/GrGLUtil.h
89        '../src/ports',     # To pull SkFontDescriptor.h
90        '../bench',
91        '../tools',
92        '../debugger/QT',   # For all the QT UI Goodies
93        '<@(qt_includes)',
94      ],
95      'sources': [
96        '../debugger/SkDebugger.cpp',
97        '../src/utils/debugger/SkDebugCanvas.h',
98        '../src/utils/debugger/SkDebugCanvas.cpp',
99        '../src/utils/debugger/SkDrawCommand.h',
100        '../src/utils/debugger/SkDrawCommand.cpp',
101        '../src/utils/debugger/SkObjectParser.h',
102        '../src/utils/debugger/SkObjectParser.cpp',
103        '../debugger/debuggermain.cpp',
104        '../debugger/QT/SkDebuggerGUI.cpp',
105        '../debugger/QT/SkDebuggerGUI.h',
106        '../debugger/QT/SkDrawCommandGeometryWidget.h',
107        '../debugger/QT/SkDrawCommandGeometryWidget.cpp',
108        '../debugger/QT/SkCanvasWidget.cpp',
109        '../debugger/QT/SkCanvasWidget.h',
110        '../debugger/QT/SkInspectorWidget.h',
111        '../debugger/QT/SkInspectorWidget.cpp',
112        '../debugger/QT/SkListWidget.h',
113        '../debugger/QT/SkListWidget.cpp',
114        '../debugger/QT/SkSettingsWidget.h',
115        '../debugger/QT/SkSettingsWidget.cpp',
116        '../debugger/QT/SkGLWidget.h',
117        '../debugger/QT/SkGLWidget.cpp',
118        '../debugger/QT/SkRasterWidget.h',
119        '../debugger/QT/SkRasterWidget.cpp',
120
121        # To update this file edit SkIcons.qrc and rerun rcc to generate cpp
122        '../debugger/QT/qrc_SkIcons.cpp',
123
124        # Generated MOC files
125        '<(moc_gen_dir)/moc_SkCanvasWidget.cpp',
126        '<(moc_gen_dir)/moc_SkDebuggerGUI.cpp',
127        '<(moc_gen_dir)/moc_SkDrawCommandGeometryWidget.cpp',
128        '<(moc_gen_dir)/moc_SkInspectorWidget.cpp',
129        '<(moc_gen_dir)/moc_SkSettingsWidget.cpp',
130        '<(moc_gen_dir)/moc_SkRasterWidget.cpp',
131        '<(moc_gen_dir)/moc_SkGLWidget.cpp',
132      ],
133      'dependencies': [
134        'debugger_qt_mocs',
135        'skia_lib.gyp:skia_lib',
136        'tools.gyp:picture_renderer',
137        'tools.gyp:timer',
138      ],
139      'cflags': [
140        # Clang gets confused by QWeakPointer, see http://llvm.org/bugs/show_bug.cgi?id=13127
141        '-Wno-uninitialized',
142      ],
143      'link_settings': {
144        'libraries': [
145          '<@(qt_libs)',
146        ],
147      },
148    },
149    {
150      'target_name': 'debugger_qt_mocs',
151      'type': 'none',
152      'sources': [
153        '<(moc_src_dir)/SkCanvasWidget.h',
154        '<(moc_src_dir)/SkDebuggerGUI.h',
155        '<(moc_src_dir)/SkDrawCommandGeometryWidget.h',
156        '<(moc_src_dir)/SkInspectorWidget.h',
157        '<(moc_src_dir)/SkSettingsWidget.h',
158        '<(moc_src_dir)/SkRasterWidget.h',
159        '<(moc_src_dir)/SkGLWidget.h',
160      ],
161      'rules': [
162        {
163          'rule_name': 'generate_moc',
164          'extension': 'h',
165          'outputs': [ '<(moc_gen_dir)/moc_<(RULE_INPUT_ROOT).cpp' ],
166          'action': [ '<(qt_moc)', '-DSK_SUPPORT_GPU=<(skia_gpu)',
167                      '<(RULE_INPUT_PATH)',
168                      '-o', '<(moc_gen_dir)/moc_<(RULE_INPUT_ROOT).cpp' ],
169          'message': 'Generating <(RULE_INPUT_ROOT).cpp.',
170        },
171      ],
172    },
173  ],
174}
175