From 548550629328c1bddd5774c1a64d97d840071ae5 Mon Sep 17 00:00:00 2001 From: nakeee Date: Fri, 5 Feb 2010 09:53:33 +0000 Subject: [PATCH] pgo scons patch taken from http://forums.dolphin-emu.com/archive/index.php/thread-3852.html git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5012 8ced0084-cf51-0410-be5f-012b33b47a6e --- SConstruct | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SConstruct b/SConstruct index d9f6c229d6..f3d9046bf4 100644 --- a/SConstruct +++ b/SConstruct @@ -126,6 +126,10 @@ vars.AddVariables( ignorecase = 2 ), PathVariable('wxconfig', 'Path to the wxconfig', None), + EnumVariable('pgo', 'Profile-Guided Optimization (generate or use)', 'none', + allowed_values = ('none', 'generate', 'use'), + ignorecase = 2 + ), ('CC', 'The c compiler', 'gcc'), ('CXX', 'The c++ compiler', 'g++'), ) @@ -215,6 +219,14 @@ else: env['CXXFLAGS'] = compileFlags + [ '-fvisibility-inlines-hidden' ] env['CPPDEFINES'] = cppDefines +# pgo - Profile Guided Optimization +if env['pgo']=='generate': + compileFlags.append('-fprofile-generate') + env['LINKFLAGS']='-fprofile-generate' +if env['pgo']=='use': + compileFlags.append('-fprofile-use') + env['LINKFLAGS']='-fprofile-use' + # Configuration tests section tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,