diff options
author | Evan Martin <martine@danga.com> | 2011-09-06 18:51:50 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-09-06 18:52:32 (GMT) |
commit | 5d697b9fae48c3c0add1644eddd3f0002ec722c4 (patch) | |
tree | 1a183d4f59a02ef9296502a82eaabef697c8c231 /configure.py | |
parent | e292718907a60c464dbe471ccdc7014731a4b6a2 (diff) | |
download | Ninja-5d697b9fae48c3c0add1644eddd3f0002ec722c4.zip Ninja-5d697b9fae48c3c0add1644eddd3f0002ec722c4.tar.gz Ninja-5d697b9fae48c3c0add1644eddd3f0002ec722c4.tar.bz2 |
make --profile take an argument to use either gmon or google-pprof
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/configure.py b/configure.py index 8308c6d..fa4f0d6 100755 --- a/configure.py +++ b/configure.py @@ -28,13 +28,15 @@ import ninja_syntax parser = OptionParser() platforms = ['linux', 'freebsd', 'mingw', 'windows'] +profilers = ['gmon', 'pprof'] parser.add_option('--platform', help='target platform (' + '/'.join(platforms) + ')', choices=platforms) parser.add_option('--debug', action='store_true', help='enable debugging flags',) -parser.add_option('--profile', action='store_true', - help='enable profiling',) +parser.add_option('--profile', metavar='TYPE', + choices=['gmon', 'pprof'], + help='enable profiling (' + '/'.join(profilers) + ')',) (options, args) = parser.parse_args() platform = options.platform @@ -81,9 +83,11 @@ if platform == 'mingw': ldflags.append('-Lgtest-1.6.0/lib/.libs') else: n.variable('cxx', os.environ.get('CXX', 'g++')) - if options.profile: + if options.profile == 'gmon': cflags.append('-pg') ldflags.append('-pg') + elif options.profile == 'pprof': + ldflags.append('-lprofiler') if 'CFLAGS' in os.environ: cflags.append(os.environ['CFLAGS']) |