Unreviewed build fix after change set r200447.
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 May 2016 17:14:49 +0000 (17:14 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 May 2016 17:14:49 +0000 (17:14 +0000)
Made the detection of clang version XCode build specific.
Now shouldEnableDebugAnnotations() should return false for all other build types.

* offlineasm/config.rb:

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/offlineasm/config.rb

index 541fdb7..5851fc7 100644 (file)
@@ -1,3 +1,12 @@
+2016-05-05  Michael Saboff  <msaboff@apple.com>
+
+        Unreviewed build fix after change set r200447.
+
+        Made the detection of clang version XCode build specific.
+        Now shouldEnableDebugAnnotations() should return false for all other build types.
+
+        * offlineasm/config.rb:
+
 2016-05-05  Joseph Pecoraro  <pecoraro@apple.com>
 
         Create console object lazily
index cfbd3cb..88a0cf5 100644 (file)
@@ -60,18 +60,15 @@ $enableInstrAnnotations = false
 # Allows for source level debuging of the original .asm files in a debugger.
 #
 def shouldEnableDebugAnnotations()
-    if ENV['GCC_VERSION'] =~ /\.clang\./ and ENV['TOOLCHAIN_DIR'] != ''
-        clangExecutable = ENV['TOOLCHAIN_DIR'] + '/usr/bin/clang'
-        if File.executable?(clangExecutable)
-            clangVersionOut = %x`#{clangExecutable} --version`
-            if ($? == 0)
-                # clang version 800.0.12 or higher is required for debug annotations
-                versionMatch = /clang-(\d+).(\d+).(\d+)/.match(clangVersionOut)
-                if versionMatch.length >= 4
-                    totalVersion = versionMatch[1].to_i * 1000000 + versionMatch[2].to_i * 1000 + versionMatch[3].to_i
-                    if totalVersion >= 800000012
-                        return true
-                    end
+    if ENV['GCC_VERSION'] =~ /\.clang\./ and ENV['DT_TOOLCHAIN_DIR'] =~ /Xcode.app/
+        clangVersionOut = %x`xcrun clang --version`
+        if ($? == 0)
+            # clang version 800.0.12 or higher is required for debug annotations
+            versionMatch = /clang-(\d{3,}).(\d{1,3}).(\d{1,3})/.match(clangVersionOut)
+            if versionMatch.length >= 4
+                totalVersion = versionMatch[1].to_i * 1000000 + versionMatch[2].to_i * 1000 + versionMatch[3].to_i
+                if totalVersion >= 800000012
+                    return true
                 end
             end
         end