Clean up CPDF_AnnotList.
[pdfium.git] / pdfium.gyp
index a728cea..67aeade 100644 (file)
@@ -1,6 +1,9 @@
 {
   'variables': {
+    # TODO(thakis): Enable this, pdfium:29
+    #'chromium_code': 1,
     'pdf_use_skia%': 0,
+    'pdf_enable_v8%': 1,
     'conditions': [
       ['OS=="linux"', {
         'bundle_freetype%': 0,
@@ -23,6 +26,9 @@
       ['pdf_use_skia==1', {
         'defines': ['_SKIA_SUPPORT_'],
       }],
+      ['pdf_enable_v8==1', {
+        'defines': ['PDF_ENABLE_V8'],
+      }],
       ['OS=="linux"', {
         'conditions': [
           ['target_arch=="x64"', {
       }],
     ],
     'msvs_disabled_warnings': [
-      4005, 4018, 4146, 4333, 4345, 4267
+      4005, 4018, 4146, 4333, 4345, 4267,
+      # TODO(thestig): Fix all instances, remove this, pdfium:29
+      4245, 4310, 4389, 4701, 4702, 4706, 4800,
     ],
+    'variables': {
+      'clang_warning_flags': [
+        # TODO(thestig): Fix all instances, remove this, pdfium:29
+        '-Wno-sign-compare',
+      ],
+      # Make sure Chromium's build/common.gypi doesn't re-add the flag on linux.
+      'cflags_cc!': [ '-Wsign-compare' ],
+    },
   },
   'targets': [
     {
         'fxedit',
         'fxge',
         'javascript',
-        'jsapi',
         'pdfwindow',
       ],
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'fpdfsdk/include/fsdk_actionhandler.h',
         'fpdfsdk/include/fsdk_annothandler.h',
         'fpdfsdk/src/fsdk_baseform.cpp',
         'fpdfsdk/src/fsdk_mgr.cpp',
         'fpdfsdk/src/fsdk_rendercontext.cpp',
-        'fpdfsdk/src/fpdfsdkdll.rc',
-        'fpdfsdk/src/resource.h',
         'public/fpdf_dataavail.h',
         'public/fpdf_doc.h',
         'public/fpdf_edit.h',
         'public/fpdfview.h',
       ],
       'conditions': [
-        ['OS!="win"', {
-          'sources!': [
-            'fpdfsdk/src/fpdfsdkdll.rc',
-          ],
-        }],
         ['bundle_freetype==1', {
           'dependencies': [
             'third_party/third_party.gyp:fx_freetype',
     {
       'target_name': 'fdrm',
       'type': 'static_library',
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'core/include/fdrm/fx_crypt.h',
         'core/src/fdrm/crypto/fx_crypt.cpp',
     {
       'target_name': 'fpdfdoc',
       'type': 'static_library',
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'core/include/fpdfdoc/fpdf_ap.h',
         'core/include/fpdfdoc/fpdf_doc.h',
     {
       'target_name': 'fpdfapi',
       'type': 'static_library',
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'core/include/fpdfapi/fpdfapi.h',
         'core/include/fpdfapi/fpdf_module.h',
     {
       'target_name': 'fpdftext',
       'type': 'static_library',
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'core/include/fpdftext/fpdf_text.h',
         'core/src/fpdftext/fpdf_text.cpp',
         'third_party/third_party.gyp:fx_libopenjpeg',
         'third_party/third_party.gyp:fx_zlib',
       ],
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'core/include/fxcodec/fx_codec.h',
         'core/include/fxcodec/fx_codec_def.h',
         'core/include/fxcodec/fx_codec_flate.h',
-        'core/include/fxcodec/fx_codec_provider.h',
         'core/src/fxcodec/codec/codec_int.h',
         'core/src/fxcodec/codec/fx_codec.cpp',
         'core/src/fxcodec/codec/fx_codec_fax.cpp',
     {
       'target_name': 'fxcrt',
       'type': 'static_library',
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'core/include/fxcrt/fx_basic.h',
         'core/include/fxcrt/fx_bidi.h',
     {
       'target_name': 'fxge',
       'type': 'static_library',
-      'ldflags': [
-        '-L<(PRODUCT_DIR)',
-      ],
       'dependencies': [
         'third_party/third_party.gyp:fx_agg',
       ],
     {
       'target_name': 'fxedit',
       'type': 'static_library',
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'fpdfsdk/include/fxedit/fx_edit.h',
         'fpdfsdk/include/fxedit/fxet_edit.h',
     {
       'target_name': 'pdfwindow',
       'type': 'static_library',
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'fpdfsdk/include/pdfwindow/IPDFWindow.h',
         'fpdfsdk/include/pdfwindow/PDFWindow.h',
     {
       'target_name': 'javascript',
       'type': 'static_library',
-      'include_dirs': [
-        '<(DEPTH)/v8',
-        '<(DEPTH)/v8/include',
-      ],
-      'dependencies': [
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-      ],
-      'export_dependent_settings': [
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-      ],
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'fpdfsdk/include/javascript/IJavaScript.h',
-        'fpdfsdk/src/javascript/app.cpp',
-        'fpdfsdk/src/javascript/color.cpp',
-        'fpdfsdk/src/javascript/console.cpp',
-        'fpdfsdk/src/javascript/Consts.cpp',
-        'fpdfsdk/src/javascript/Consts.h',
-        'fpdfsdk/src/javascript/Document.cpp',
-        'fpdfsdk/src/javascript/Document.h',
-        'fpdfsdk/src/javascript/Field.cpp',
-        'fpdfsdk/src/javascript/Field.h',
-        'fpdfsdk/src/javascript/Icon.cpp',
-        'fpdfsdk/src/javascript/Icon.h',
-        'fpdfsdk/src/javascript/JS_Context.cpp',
-        'fpdfsdk/src/javascript/JS_Context.h',
-        'fpdfsdk/src/javascript/JS_Define.h',
-        'fpdfsdk/src/javascript/JS_EventHandler.cpp',
-        'fpdfsdk/src/javascript/JS_EventHandler.h',
-        'fpdfsdk/src/javascript/JS_GlobalData.cpp',
-        'fpdfsdk/src/javascript/JS_GlobalData.h',
-        'fpdfsdk/src/javascript/JS_Object.cpp',
-        'fpdfsdk/src/javascript/JS_Object.h',
-        'fpdfsdk/src/javascript/JS_Runtime.cpp',
-        'fpdfsdk/src/javascript/JS_Runtime.h',
-        'fpdfsdk/src/javascript/JS_Value.cpp',
-        'fpdfsdk/src/javascript/JS_Value.h',
-        'fpdfsdk/src/javascript/PublicMethods.cpp',
-        'fpdfsdk/src/javascript/PublicMethods.h',
-        'fpdfsdk/src/javascript/app.cpp',
-        'fpdfsdk/src/javascript/app.h',
-        'fpdfsdk/src/javascript/color.cpp',
-        'fpdfsdk/src/javascript/color.h',
-        'fpdfsdk/src/javascript/console.cpp',
-        'fpdfsdk/src/javascript/console.h',
-        'fpdfsdk/src/javascript/event.cpp',
-        'fpdfsdk/src/javascript/event.h',
-        'fpdfsdk/src/javascript/global.cpp',
-        'fpdfsdk/src/javascript/global.h',
-        'fpdfsdk/src/javascript/report.cpp',
-        'fpdfsdk/src/javascript/report.h',
-        'fpdfsdk/src/javascript/resource.cpp',
-        'fpdfsdk/src/javascript/resource.h',
-        'fpdfsdk/src/javascript/util.cpp',
-        'fpdfsdk/src/javascript/util.h',
-      ],
-    },
-    {
-      'target_name': 'jsapi',
-      'type': 'static_library',
-      'dependencies': [
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-      ],
-      'export_dependent_settings': [
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-      ],
-      'include_dirs': [
-        '<(DEPTH)/v8',
-        '<(DEPTH)/v8/include',
+        'fpdfsdk/src/javascript/JS_Runtime_Stub.cpp',
       ],
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
-      'sources': [
-        'fpdfsdk/include/jsapi/fxjs_v8.h',
-        'fpdfsdk/src/jsapi/fxjs_v8.cpp',
+      'conditions': [
+        ['pdf_enable_v8==1', {
+          'include_dirs': [
+            '<(DEPTH)/v8',
+            '<(DEPTH)/v8/include',
+          ],
+          'dependencies': [
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
+          ],
+          'export_dependent_settings': [
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
+          ],
+          'sources!': [
+            'fpdfsdk/src/javascript/JS_Runtime_Stub.cpp',
+          ],
+          'sources': [
+            'fpdfsdk/src/javascript/Consts.cpp',
+            'fpdfsdk/src/javascript/Consts.h',
+            'fpdfsdk/src/javascript/Document.cpp',
+            'fpdfsdk/src/javascript/Document.h',
+            'fpdfsdk/src/javascript/Field.cpp',
+            'fpdfsdk/src/javascript/Field.h',
+            'fpdfsdk/src/javascript/Icon.cpp',
+            'fpdfsdk/src/javascript/Icon.h',
+            'fpdfsdk/src/javascript/JS_Context.cpp',
+            'fpdfsdk/src/javascript/JS_Context.h',
+            'fpdfsdk/src/javascript/JS_Define.h',
+            'fpdfsdk/src/javascript/JS_EventHandler.cpp',
+            'fpdfsdk/src/javascript/JS_EventHandler.h',
+            'fpdfsdk/src/javascript/JS_GlobalData.cpp',
+            'fpdfsdk/src/javascript/JS_GlobalData.h',
+            'fpdfsdk/src/javascript/JS_Object.cpp',
+            'fpdfsdk/src/javascript/JS_Object.h',
+            'fpdfsdk/src/javascript/JS_Runtime.cpp',
+            'fpdfsdk/src/javascript/JS_Runtime.h',
+            'fpdfsdk/src/javascript/JS_Value.cpp',
+            'fpdfsdk/src/javascript/JS_Value.h',
+            'fpdfsdk/src/javascript/PublicMethods.cpp',
+            'fpdfsdk/src/javascript/PublicMethods.h',
+            'fpdfsdk/src/javascript/app.cpp',
+            'fpdfsdk/src/javascript/app.cpp',
+            'fpdfsdk/src/javascript/app.h',
+            'fpdfsdk/src/javascript/color.cpp',
+            'fpdfsdk/src/javascript/color.cpp',
+            'fpdfsdk/src/javascript/color.h',
+            'fpdfsdk/src/javascript/console.cpp',
+            'fpdfsdk/src/javascript/console.cpp',
+            'fpdfsdk/src/javascript/console.h',
+            'fpdfsdk/src/javascript/event.cpp',
+            'fpdfsdk/src/javascript/event.h',
+            'fpdfsdk/src/javascript/global.cpp',
+            'fpdfsdk/src/javascript/global.h',
+            'fpdfsdk/src/javascript/report.cpp',
+            'fpdfsdk/src/javascript/report.h',
+            'fpdfsdk/src/javascript/resource.cpp',
+            'fpdfsdk/src/javascript/resource.h',
+            'fpdfsdk/src/javascript/util.cpp',
+            'fpdfsdk/src/javascript/util.h',
+            'fpdfsdk/include/jsapi/fxjs_v8.h',
+            'fpdfsdk/src/jsapi/fxjs_v8.cpp',
+          ],
+        }],
       ],
     },
     {
       'target_name': 'formfiller',
       'type': 'static_library',
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
         'fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h',
         'fpdfsdk/include/formfiller/FFL_CheckBox.h',
         'fpdfsdk/include/formfiller/FFL_FormFiller.h',
         'fpdfsdk/include/formfiller/FFL_IFormFiller.h',
         'fpdfsdk/include/formfiller/FFL_ListBox.h',
-        'fpdfsdk/include/formfiller/FFL_Notify.h',
         'fpdfsdk/include/formfiller/FFL_PushButton.h',
         'fpdfsdk/include/formfiller/FFL_RadioButton.h',
         'fpdfsdk/include/formfiller/FFL_TextField.h',
-        'fpdfsdk/include/formfiller/FFL_Utils.h',
         'fpdfsdk/include/formfiller/FormFiller.h',
         'fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp',
         'fpdfsdk/src/formfiller/FFL_CheckBox.cpp',
         'fpdfsdk/src/formfiller/FFL_FormFiller.cpp',
         'fpdfsdk/src/formfiller/FFL_IFormFiller.cpp',
         'fpdfsdk/src/formfiller/FFL_ListBox.cpp',
-        'fpdfsdk/src/formfiller/FFL_Notify.cpp',
         'fpdfsdk/src/formfiller/FFL_PushButton.cpp',
         'fpdfsdk/src/formfiller/FFL_RadioButton.cpp',
         'fpdfsdk/src/formfiller/FFL_TextField.cpp',
-        'fpdfsdk/src/formfiller/FFL_Utils.cpp',
       ],
     },
     {
         '<(DEPTH)/testing/gtest.gyp:gtest_main',
         '<(DEPTH)/testing/gtest.gyp:gtest',
         'pdfium',
+        'test_support',
       ],
       'include_dirs': [
         '<(DEPTH)'
       'dependencies': [
         '<(DEPTH)/testing/gmock.gyp:gmock',
         '<(DEPTH)/testing/gtest.gyp:gtest',
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8_libplatform',
         'pdfium',
+        'test_support',
       ],
       'include_dirs': [
         '<(DEPTH)',
-        '<(DEPTH)/v8',
-        '<(DEPTH)/v8/include',
       ],
       'sources': [
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp',
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp',
+        'core/src/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp',
         'fpdfsdk/src/fpdf_dataavail_embeddertest.cpp',
         'fpdfsdk/src/fpdfdoc_embeddertest.cpp',
         'fpdfsdk/src/fpdfformfill_embeddertest.cpp',
         'fpdfsdk/src/fpdfview_c_api_test.c',
         'fpdfsdk/src/fpdfview_c_api_test.h',
         'fpdfsdk/src/fpdfview_embeddertest.cpp',
-        'fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp',
         'testing/embedder_test.cpp',
         'testing/embedder_test.h',
         'testing/embedder_test_mock_delegate.h',
         'testing/embedder_test_timer_handling_delegate.h',
+      ],
+      'conditions': [
+        ['pdf_enable_v8==1', {
+          'include_dirs': [
+            '<(DEPTH)/v8',
+            '<(DEPTH)/v8/include',
+          ],
+          'dependencies': [
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8_libplatform',
+          ],
+          'sources': [
+            'fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp',
+          ],
+        }],
+      ],
+    },
+    {
+      'target_name': 'test_support',
+      'type': 'static_library',
+      'dependencies': [
+        '<(DEPTH)/testing/gmock.gyp:gmock',
+        '<(DEPTH)/testing/gtest.gyp:gtest',
+      ],
+      'include_dirs': [
+        '<(DEPTH)',
+      ],
+      'sources': [
         'testing/fx_string_testhelpers.cpp',
         'testing/fx_string_testhelpers.h',
+        'testing/test_support.cpp',
+        'testing/test_support.h',
+      ],
+      'conditions': [
+        ['pdf_enable_v8==1', {
+          'include_dirs': [
+            '<(DEPTH)/v8',
+            '<(DEPTH)/v8/include',
+          ],
+          'dependencies': [
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8_libplatform',
+          ],
+        }],
       ],
     },
   ],