fiddle_build_test/gyp: fix mac mesa build (2)

TBR=
NOTRY=true

Review URL: https://codereview.chromium.org/1900173002
diff --git a/gyp/tools.gyp b/gyp/tools.gyp
index 6c96ca5..190e1fe 100644
--- a/gyp/tools.gyp
+++ b/gyp/tools.gyp
@@ -591,7 +591,7 @@
         ],
       },
     ],
-    ['skia_os in ["linux", "mac"]',
+    ['skia_mesa and skia_os in ["linux", "mac"]',
       {
         'targets': [
           {
@@ -607,7 +607,16 @@
               'pdf.gyp:pdf',
             ],
             'defines': [ 'FIDDLE_BUILD_TEST' ],
-            'link_settings': { 'libraries': [ '-lOSMesa' ], },
+            'conditions': [
+              [ 'skia_os == "mac"',
+                {
+                  'link_settings': { 'libraries': [ '/opt/X11/lib/libOSMesa.dylib', ], },
+                  'include_dirs': [ '/opt/X11/include/', ],
+                }, {
+                  'link_settings': { 'libraries': [ '-lOSMesa' ], },
+                }
+              ],
+            ],
           },
         ],
       },