Switch GCMole to use GYP build file instead of SCons.
authormstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 19 Apr 2013 12:46:32 +0000 (12:46 +0000)
committermstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 19 Apr 2013 12:46:32 +0000 (12:46 +0000)
R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14350 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

tools/gcmole/gcmole.lua
tools/gyp/v8.gyp

index 09db547..60ad010 100644 (file)
@@ -117,31 +117,25 @@ function InvokeClangPluginForEachFile(filenames, cfg, func)
 end
 
 -------------------------------------------------------------------------------
--- SConscript parsing
+-- GYP file parsing
 
-local function ParseSConscript()
-   local f = assert(io.open("src/SConscript"), "failed to open SConscript")
-   local sconscript = f:read('*a')
+local function ParseGYPFile()
+   local f = assert(io.open("tools/gyp/v8.gyp"), "failed to open GYP file")
+   local gyp = f:read('*a')
    f:close()
 
-   local SOURCES = sconscript:match "SOURCES = {(.-)}";
+   local result = {}
 
-   local sources = {}
-
-   for condition, list in
-      SOURCES:gmatch "'([^']-)': Split%(\"\"\"(.-)\"\"\"%)" do
+   for condition, sources in
+      gyp:gmatch "'sources': %[.-### gcmole%((.-)%) ###(.-)%]" do
       local files = {}
-      for file in list:gmatch "[^%s]+" do table.insert(files, file) end
-      sources[condition] = files
-   end
-
-   for condition, list in SOURCES:gmatch "'([^']-)': %[(.-)%]" do
-      local files = {}
-      for file in list:gmatch "'([^']-)'" do table.insert(files, file) end
-      sources[condition] = files
+      for file in sources:gmatch "'%.%./%.%./src/([^']-%.cc)'" do
+         table.insert(files, file)
+      end
+      result[condition] = files
    end
 
-   return sources
+   return result
 end
 
 local function EvaluateCondition(cond, props)
@@ -165,7 +159,7 @@ local function BuildFileList(sources, props)
    return list
 end
 
-local sources = ParseSConscript()
+local sources = ParseGYPFile()
 
 local function FilesForArch(arch)
    return BuildFileList(sources, { os = 'linux',
index d285205..7070d97 100644 (file)
           'include_dirs+': [
             '../../src',
           ],
-          'sources': [
+          'sources': [  ### gcmole(all) ###
             '../../src/accessors.cc',
             '../../src/accessors.h',
             '../../src/allocation.cc',
               'toolsets': ['target'],
             }],
             ['v8_target_arch=="arm"', {
-              'sources': [
+              'sources': [  ### gcmole(arch:arm) ###
                 '../../src/arm/assembler-arm-inl.h',
                 '../../src/arm/assembler-arm.cc',
                 '../../src/arm/assembler-arm.h',
               ],
             }],
             ['v8_target_arch=="ia32" or v8_target_arch=="mac" or OS=="mac"', {
-              'sources': [
+              'sources': [  ### gcmole(arch:ia32) ###
                 '../../src/ia32/assembler-ia32-inl.h',
                 '../../src/ia32/assembler-ia32.cc',
                 '../../src/ia32/assembler-ia32.h',
               ],
             }],
             ['v8_target_arch=="mipsel"', {
-              'sources': [
+              'sources': [  ### gcmole(arch:mipsel) ###
                 '../../src/mips/assembler-mips.cc',
                 '../../src/mips/assembler-mips.h',
                 '../../src/mips/assembler-mips-inl.h',
               ],
             }],
             ['v8_target_arch=="x64" or v8_target_arch=="mac" or OS=="mac"', {
-              'sources': [
+              'sources': [  ### gcmole(arch:x64) ###
                 '../../src/x64/assembler-x64-inl.h',
                 '../../src/x64/assembler-x64.cc',
                 '../../src/x64/assembler-x64.h',
                     }],
                   ],
                 },
-                'sources': [
+                'sources': [  ### gcmole(os:linux) ###
                   '../../src/platform-linux.cc',
                   '../../src/platform-posix.cc'
                 ],
           ],
         },
       ],
-    }, { # use_system_v8 != 0
+    }, {  # use_system_v8 != 0
       'targets': [
         {
           'target_name': 'v8',