[Win] Fix bindings tests after r189934.
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Sep 2015 21:30:28 +0000 (21:30 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Sep 2015 21:30:28 +0000 (21:30 +0000)
Reviewed by Brent Fulgham.

* bindings/scripts/preprocessor.pm:
(applyPreprocessor):
Bindings tests use /usr/bin/gcc from cygwin, which requires different flags.
If we're using gcc to preprocess, use it like we did before r189934.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189985 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/preprocessor.pm

index 5d25da4..581b8fe 100644 (file)
@@ -1,3 +1,14 @@
+2015-09-18  Alex Christensen  <achristensen@webkit.org>
+
+        [Win] Fix bindings tests after r189934.
+
+        Reviewed by Brent Fulgham.
+
+        * bindings/scripts/preprocessor.pm:
+        (applyPreprocessor):
+        Bindings tests use /usr/bin/gcc from cygwin, which requires different flags.
+        If we're using gcc to preprocess, use it like we did before r189934.
+
 2015-09-18  Eric Carlson  <eric.carlson@apple.com>
 
         [MediaStream] Finish implementing MediaDevices.enumerateDevices
index c6bac3c..2262bd6 100644 (file)
@@ -76,18 +76,22 @@ sub applyPreprocessor
 
     my $pid = 0;
     if ($Config{osname} eq "cygwin") {
-        $preprocessor =~ /"(.*)"/;
-        my $preprocessorExecutable = $preprocessor;
-        chomp($preprocessorExecutable = `cygpath -u '$1'`) unless (not defined $1);
-        chomp($fileName = `cygpath -w '$fileName'`);
-            
+        my @preprocessorAndFlags;
+        if ($preprocessor eq "/usr/bin/gcc") {
+            @preprocessorAndFlags = split(' ', $preprocessor);
+        } else {        
+            $preprocessor =~ /"(.*)"/;
+            chomp(my $preprocessor = `cygpath -u '$1'`) if (defined $1);
+            chomp($fileName = `cygpath -w '$fileName'`);
+            @preprocessorAndFlags = ($preprocessor, "/nologo", "/EP");
+        }
         # This call can fail if Windows rebases cygwin, so retry a few times until it succeeds.
         for (my $tries = 0; !$pid && ($tries < 20); $tries++) {
             eval {
                 # Suppress STDERR so that if we're using cl.exe, the output
                 # name isn't needlessly echoed.
                 use Symbol 'gensym'; my $err = gensym;
-                $pid = open3(\*PP_IN, \*PP_OUT, $err, $preprocessorExecutable, "/nologo", "/EP", @args, @macros, $fileName);
+                $pid = open3(\*PP_IN, \*PP_OUT, $err, @preprocessorAndFlags, @args, @macros, $fileName);
                 1;
             } or do {
                 sleep 1;