From ef9b0a8e2f623f1696034475fb390541b949e503 Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Wed, 24 Sep 2008 08:47:39 +0000 Subject: [PATCH] Added a profiling option (prof) to the SCons build. Currently 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SConstruct b/SConstruct index 28719ba..52a1b2b 100644 --- a/SConstruct +++ b/SConstruct @@ -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)." % -- 2.7.4