summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2015-10-27 21:26:12 +1000
committerTim Mayberry <mojofunk@gmail.com>2015-11-18 09:38:18 +1000
commit3a266ff5e8bad36a219673cdbd2ba34494aa8f39 (patch)
tree51e797a2c0494ce69011d67472a921ed04127ba1 /wscript
parentbb5b0a6d8a9f6a8a18d5e96b28ba7250a8153309 (diff)
Add --profile waf option so frame pointer isn't omitted in optimized builds
Diffstat (limited to 'wscript')
-rw-r--r--wscript15
1 files changed, 11 insertions, 4 deletions
diff --git a/wscript b/wscript
index b864d95464..9ef5ab7e36 100644
--- a/wscript
+++ b/wscript
@@ -40,8 +40,10 @@ compiler_flags_dictionaries= {
'linker-debuggable' : '',
# Flags required when building a non-debug optimized build
'nondebuggable' : '-DNDEBUG',
- # Flags required to enable profiling at runtime
- 'profile' : '-pg',
+ # Flags required to enable profiling at runtime with optimized builds
+ 'profile' : [ '-fno-omit-frame-pointer' ],
+ # Flags required to enable gprofile profiling
+ 'gprofile' : '-pg',
# Flags required to disable warnings about unused arguments to function calls
'silence-unused-arguments' : '',
# Flags required to use SSE unit for general math
@@ -89,7 +91,7 @@ compiler_flags_dictionaries= {
'debuggable' : ['/DDEBUG', '/Od', '/Zi', '/MDd', '/Gd', '/EHsc'],
'linker-debuggable' : ['/DEBUG', '/INCREMENTAL' ],
'nondebuggable' : ['/DNDEBUG', '/Ob1', '/MD', '/Gd', '/EHsc'],
- 'profile' : '',
+ 'profile' : '/Oy-',
'sse' : '/arch:SSE',
'silence-unused-arguments' : '',
'sse' : '',
@@ -332,7 +334,7 @@ int main() { return 0; }''',
linker_flags.append('-fsanitize=address')
if opt.gprofile:
- debug_flags = [ flags_dict['profile'] ]
+ debug_flags = [ flags_dict['gprofile'] ]
# OSX
if platform == 'darwin':
@@ -545,6 +547,9 @@ int main() { return 0; }''',
if opt.debug_symbols:
optimization_flags += flags_dict['debuggable']
+ if opt.profile:
+ optimization_flags += flags_dict['profile']
+
if opt.stl_debug:
cxx_flags.append("-D_GLIBCXX_DEBUG")
@@ -646,6 +651,8 @@ def options(opt):
help='Build MIME type and .desktop files as per freedesktop.org standards (will be placed in build/gtk2_ardour)')
opt.add_option('--freebie', action='store_true', default=False, dest='freebie',
help='Build a version suitable for distribution as a zero-cost binary')
+ opt.add_option('--profile', action='store_true', default=False, dest='profile',
+ help='Compile for use with profiling tools requiring a frame pointer')
opt.add_option('--gprofile', action='store_true', default=False, dest='gprofile',
help='Compile for use with gprofile')
opt.add_option('--libjack', type='string', default="auto", dest='libjack_link',