Added a profiling option (prof) to the SCons build. Currently
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 24 Sep 2008 08:47:39 +0000 (08:47 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 24 Sep 2008 08:47:39 +0000 (08:47 +0000)
it just makes the linker generate a MAP file for the shell
sample on Windows.
Review URL: http://codereview.chromium.org/4064

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

SConstruct

index 28719ba..52a1b2b 100644 (file)
@@ -201,6 +201,9 @@ SAMPLE_FLAGS = {
     'library:shared': {
       'CPPDEFINES': ['USING_V8_SHARED']
     },
+    'prof:on': {
+      'LINKFLAGS': ['/MAP']
+    },
     'mode:release': {
       'CCFLAGS':   ['/Ox', '/MT', '/GF'],
       'LINKFLAGS': ['/OPT:REF', '/OPT:ICF']
@@ -280,6 +283,11 @@ SIMPLE_OPTIONS = {
     'default': 'off',
     'help': 'build using snapshots for faster start-up'
   },
+  'prof': {
+    'values': ['on', 'off'],
+    'default': 'off',
+    'help': 'enable profiling of build target'
+  },
   'library': {
     'values': ['static', 'shared'],
     'default': 'static',
@@ -337,6 +345,8 @@ def VerifyOptions(env):
     return False
   if not IsLegal(env, 'sample', ["shell", "process"]):
     return False
+  if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on':
+    Abort("Profiling on windows only supported for static library.")
   for (name, option) in SIMPLE_OPTIONS.iteritems():
     if (not option.get('default')) and (name not in ARGUMENTS):
       message = ("A value for option %s must be specified (%s)." %