pdfviewer: (cleanup) put the gyp for library code in a separate file
authoredisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 16 Aug 2013 16:13:44 +0000 (16:13 +0000)
committeredisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 16 Aug 2013 16:13:44 +0000 (16:13 +0000)
Review URL: https://codereview.chromium.org/23038004

git-svn-id: http://skia.googlecode.com/svn/trunk@10779 2bbb7eff-a529-9590-31e7-b0007b416f81

gyp/SampleApp.gyp
gyp/pdfviewer.gyp
gyp/pdfviewer_lib.gyp [new file with mode: 0644]

index 4fb8a84807026b448b580ac3697a03734df77e5a..602264f74386f3f62035a04a895a34e5106ae124 100644 (file)
@@ -1,6 +1,6 @@
 {
   'variables': {
-    #manaully set sample_pdf_file_viewer to 1 to have the PdfViewer in SampleApp
+    #manually set sample_pdf_file_viewer to 1 to have the PdfViewer in SampleApp
     'sample_pdf_file_viewer%': 0,
   },
   'targets': [
            'SAMPLE_PDF_FILE_VIEWER',
          ],
          'dependencies': [
-           'pdfviewer.gyp:libpdfviewer',
+           'pdfviewer_lib.gyp:libpdfviewer_lib',
          ],
          'include_dirs' : [
            '../experimental/PdfViewer/',
index ac677bf4f01cf9ba93051906f8242367db5e7a9a..1f7877f179a71d6be5cd0959e9f0f6e82db494a8 100644 (file)
   'includes': [
     'apptype_console.gypi',
   ],
-  # TODO(edisonn): Hack! on mack, SHARED_INTERMEDIATE_DIR can't be reliable used in a sources context
-  'conditions' : [
-    [ 'skia_os != "mac"', {
-        'variables': {
-          'GENERATE_DIR%' : '<(SHARED_INTERMEDIATE_DIR)',
-        },
-      },
-    ],
-    [ 'skia_os == "mac"', {
-        'variables': {
-          'GENERATE_DIR%' : '../src/tmp_autogen',
-        },
-      },
-    ],
-  ],
   'targets': [
-    {
-      'target_name': 'libpdfviewer',
-      'type': 'static_library',
-      'sources': [
-        '../experimental/PdfViewer/SkPdfGraphicsState.cpp',
-        '../experimental/PdfViewer/SkPdfFont.cpp',
-        '../experimental/PdfViewer/SkPdfRenderer.cpp',
-        '../experimental/PdfViewer/SkPdfUtils.cpp',
-        #'../experimental/PdfViewer/SkPdfNYI.cpp',
-        '../experimental/PdfViewer/SkTrackDevice.cpp',
-        '../experimental/PdfViewer/SkTracker.cpp',
-        '../experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp',
-        '../experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp',
-        '../experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp',
-        '<(GENERATE_DIR)/native/autogen/SkPdfMapper_autogen.cpp',
-        '<(GENERATE_DIR)/native/autogen/SkPdfHeaders_autogen.cpp',
-      ],
-      'actions': [
-        {
-          'action_name': 'spec2def',
-          'inputs': [
-            '../experimental/PdfViewer/spec2def.py',
-            '../experimental/PdfViewer/PdfReference-okular-1.txt',
-          ],
-          'outputs': [
-            '<(GENERATE_DIR)/pdfspec_autogen.py',
-          ],
-          'action': ['python', '../experimental/PdfViewer/spec2def.py', '../experimental/PdfViewer/PdfReference-okular-1.txt', '<(GENERATE_DIR)/pdfspec_autogen.py'],
-        },
-        {
-          'action_name': 'copy_files1',
-          'inputs' : ['../experimental/PdfViewer/datatypes.py'],
-          'outputs': [
-            '<(GENERATE_DIR)/datatypes.py',
-          ],
-          'action': ['python', '../experimental/PdfViewer/copy_files.py', '<(GENERATE_DIR)', '../experimental/PdfViewer/datatypes.py'],
-        },
-        {
-          'action_name': 'copy_files2',
-
-          'inputs' : ['../experimental/PdfViewer/generate_code.py'],
-          'outputs': [
-            '<(GENERATE_DIR)/generate_code.py',
-          ],
-          'action': ['python', '../experimental/PdfViewer/copy_files.py', '<(GENERATE_DIR)', '../experimental/PdfViewer/generate_code.py'],
-        },
-        {
-          'action_name': 'generate_code',
-          'inputs': [
-            '<(GENERATE_DIR)/datatypes.py',
-            '<(GENERATE_DIR)/generate_code.py',
-            '<(GENERATE_DIR)/pdfspec_autogen.py',
-          ],
-          'outputs': [
-            '<(GENERATE_DIR)/native/autogen/SkPdfEnums_autogen.h',
-            '<(GENERATE_DIR)/native/autogen/SkPdfMapper_autogen.h',
-            '<(GENERATE_DIR)/native/autogen/SkPdfHeaders_autogen.h',
-            '<(GENERATE_DIR)/native/autogen/SkPdfMapper_autogen.cpp',
-            '<(GENERATE_DIR)/native/autogen/SkPdfHeaders_autogen.cpp',
-            # TODO(edisonn): ok, there are many more files here, which we should list but since
-            # any change in the above should trigger a change here, we should be fine normally
-          ],
-          'action': ['python', '<(GENERATE_DIR)/generate_code.py', '<(GENERATE_DIR)'],
-        },
-      ],
-      'include_dirs': [
-        '../experimental/PdfViewer',
-        '../experimental/PdfViewer/pdfparser',
-        '../experimental/PdfViewer/pdfparser/native',
-        '<(GENERATE_DIR)/native/autogen',
-      ],
-      'dependencies': [
-        'skia_lib.gyp:skia_lib',
-        'zlib.gyp:zlib',
-      ],
-    },
     {
       'target_name': 'pdfviewer',
       'type': 'executable',
-      'cflags': ['-fexceptions'],
-      'cflags_cc': ['-fexceptions'],
-      'cflags!': [ '-fno-exceptions' ],
-      'cflags_cc!': [ '-fno-exceptions' ],
       'sources': [
         '../experimental/PdfViewer/pdf_viewer_main.cpp',
       ],
       'include_dirs': [
         '../experimental/PdfViewer',
         '../experimental/PdfViewer/pdfparser',
-        '../experimental/PdfViewer/pdfparser/autogen',
         '../experimental/PdfViewer/pdfparser/native',
-        '../experimental/PdfViewer/pdfparser/native/autogen',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
-        'flags.gyp:flags',
-        'libpdfviewer',
         'chop_transparency',
+        'flags.gyp:flags',
+        'pdfviewer_lib.gyp:pdfviewer_lib',
+        'skia_lib.gyp:skia_lib',
       ],
     },
     {
         '../src/utils/',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
         'flags.gyp:flags',
+        'skia_lib.gyp:skia_lib',
       ],
     },
   ],
diff --git a/gyp/pdfviewer_lib.gyp b/gyp/pdfviewer_lib.gyp
new file mode 100644 (file)
index 0000000..707adf6
--- /dev/null
@@ -0,0 +1,106 @@
+# GYP file to build pdfviewer.
+#
+# To build on Linux:
+#  ./gyp_skia pdfviewer.gyp && make pdfviewer
+#
+{
+  # TODO(edisonn): Hack! on mack, SHARED_INTERMEDIATE_DIR can't be reliable used in a sources context
+  'conditions' : [
+    [ 'skia_os != "mac"', {
+        'variables': {
+          'GENERATE_DIR%' : '<(SHARED_INTERMEDIATE_DIR)',
+        },
+      },
+    ],
+    [ 'skia_os == "mac"', {
+        'variables': {
+          'GENERATE_DIR%' : '../src/tmp_autogen',
+        },
+      },
+    ],
+  ],
+  'targets': [
+    {
+      'target_name': 'pdfviewer_lib',
+      'type': 'static_library',
+      'sources': [
+        '../experimental/PdfViewer/SkPdfGraphicsState.cpp',
+        '../experimental/PdfViewer/SkPdfFont.cpp',
+        '../experimental/PdfViewer/SkPdfRenderer.cpp',
+        '../experimental/PdfViewer/SkPdfUtils.cpp',
+        #'../experimental/PdfViewer/SkPdfNYI.cpp',
+        '../experimental/PdfViewer/SkTrackDevice.cpp',
+        '../experimental/PdfViewer/SkTracker.cpp',
+        '../experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp',
+        '../experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp',
+        '../experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp',
+        '<(GENERATE_DIR)/native/autogen/SkPdfMapper_autogen.cpp',
+        '<(GENERATE_DIR)/native/autogen/SkPdfHeaders_autogen.cpp',
+      ],
+      'actions': [
+        {
+          'action_name': 'spec2def',
+          'inputs': [
+            '../experimental/PdfViewer/spec2def.py',
+            '../experimental/PdfViewer/PdfReference-okular-1.txt',
+          ],
+          'outputs': [
+            '<(GENERATE_DIR)/pdfspec_autogen.py',
+          ],
+          'action': ['python', '../experimental/PdfViewer/spec2def.py', '../experimental/PdfViewer/PdfReference-okular-1.txt', '<(GENERATE_DIR)/pdfspec_autogen.py'],
+        },
+        {
+          'action_name': 'copy_files1',
+          'inputs' : ['../experimental/PdfViewer/datatypes.py'],
+          'outputs': [
+            '<(GENERATE_DIR)/datatypes.py',
+          ],
+          'action': ['python', '../experimental/PdfViewer/copy_files.py', '<(GENERATE_DIR)', '../experimental/PdfViewer/datatypes.py'],
+        },
+        {
+          'action_name': 'copy_files2',
+
+          'inputs' : ['../experimental/PdfViewer/generate_code.py'],
+          'outputs': [
+            '<(GENERATE_DIR)/generate_code.py',
+          ],
+          'action': ['python', '../experimental/PdfViewer/copy_files.py', '<(GENERATE_DIR)', '../experimental/PdfViewer/generate_code.py'],
+        },
+        {
+          'action_name': 'generate_code',
+          'inputs': [
+            '<(GENERATE_DIR)/datatypes.py',
+            '<(GENERATE_DIR)/generate_code.py',
+            '<(GENERATE_DIR)/pdfspec_autogen.py',
+          ],
+          'outputs': [
+            '<(GENERATE_DIR)/native/autogen/SkPdfEnums_autogen.h',
+            '<(GENERATE_DIR)/native/autogen/SkPdfMapper_autogen.h',
+            '<(GENERATE_DIR)/native/autogen/SkPdfHeaders_autogen.h',
+            '<(GENERATE_DIR)/native/autogen/SkPdfMapper_autogen.cpp',
+            '<(GENERATE_DIR)/native/autogen/SkPdfHeaders_autogen.cpp',
+            # TODO(edisonn): ok, there are many more files here, which we should list but since
+            # any change in the above should trigger a change here, we should be fine normally
+          ],
+          'action': ['python', '<(GENERATE_DIR)/generate_code.py', '<(GENERATE_DIR)'],
+        },
+      ],
+      'include_dirs': [
+        '../experimental/PdfViewer',
+        '../experimental/PdfViewer/pdfparser',
+        '../experimental/PdfViewer/pdfparser/native',
+        '<(GENERATE_DIR)/native/autogen',
+      ],
+      'dependencies': [
+        'skia_lib.gyp:skia_lib',
+        'zlib.gyp:zlib',
+      ],
+    },
+  ],
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2: