pdfviewer: compile pdfviewer in gm, only if the flag is set (currently we compile pdfviewer, even if it is not used)

R=scroggo@google.com, jvanverth@google.com

Author: edisonn@google.com

Review URL: https://codereview.chromium.org/68533003

git-svn-id: http://skia.googlecode.com/svn/trunk/gyp@12249 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm.gyp b/gm.gyp
index b430da1..504b11e 100644
--- a/gm.gyp
+++ b/gm.gyp
@@ -33,7 +33,6 @@
         '../src/pipe/utils/',
         '../src/utils/',
         '../src/utils/debugger',
-        '../experimental/PdfViewer',
       ],
       'includes': [
         'gmslides.gypi',
@@ -59,13 +58,18 @@
         'gm.gyp:gm_expectations',
         'jsoncpp.gyp:jsoncpp',
         'pdf.gyp:pdf',
-        'pdfviewer_lib.gyp:pdfviewer_lib',
       ],
       'conditions': [
         ['skia_run_pdfviewer_in_gm', {
           'defines': [
             'SK_BUILD_NATIVE_PDF_RENDERER',
           ],
+          'include_dirs' : [
+            '../experimental/PdfViewer',
+          ],
+          'dependencies': [
+            'pdfviewer_lib.gyp:pdfviewer_lib',
+          ],
         }],
         ['skia_os in ["linux", "mac", "win"]', {
           'dependencies': [
diff --git a/utils.gyp b/utils.gyp
index 1725910..2133d2b 100644
--- a/utils.gyp
+++ b/utils.gyp
@@ -214,6 +214,11 @@
             '../src/utils/android/ashmem.cpp',
           ],
         }],
+        ['skia_run_pdfviewer_in_gm', {
+          'defines': [
+            'SK_BUILD_NATIVE_PDF_RENDERER',
+          ],
+        }],
       ],
       'direct_dependent_settings': {
         'include_dirs': [