diff options
-rw-r--r-- | gyp/common_conditions.gypi | 11 | ||||
-rw-r--r-- | gyp/common_variables.gypi | 17 |
2 files changed, 22 insertions, 6 deletions
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index 3a49f1449e..4aa503d757 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -76,7 +76,7 @@ 'msvs_settings': { 'VCCLCompilerTool': { 'DebugInformationFormat': '3', # programDatabase (/Zi) - 'Optimization': '3', # full (/Ox) + 'Optimization': '<(skia_release_optimization_level)', 'WholeProgramOptimization': 'true', #/GL # Changing the floating point model requires rebaseling gm images #'FloatingPointModel': '2', # fast (/fp:fast) @@ -137,7 +137,10 @@ 'cflags': ['-g'] }, 'Release': { - 'cflags': ['-O3 -g'], + 'cflags': [ + '-O<(skia_release_optimization_level)', + '-g', + ], 'defines': [ 'NDEBUG' ], }, }, @@ -246,7 +249,7 @@ }, 'Release': { 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': '3', + 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)', }, 'defines': [ 'NDEBUG' ], }, @@ -312,7 +315,7 @@ }, 'Release': { 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': '3', + 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)', }, 'defines': [ 'NDEBUG' ], }, diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi index 9b44e41a9e..3a42fdc460 100644 --- a/gyp/common_variables.gypi +++ b/gyp/common_variables.gypi @@ -91,6 +91,11 @@ 'skia_profile_enabled%': 0, 'skia_win_debuggers_path%': '', 'skia_shared_lib%': 0, + + # These variables determine the default optimization level for different + # compilers. + 'skia_default_vs_optimization_level': 3, # full (/Ox) + 'skia_default_gcc_optimization_level': 3, # -O3 }, 'conditions': [ @@ -101,6 +106,16 @@ }, { 'skia_warnings_as_errors%': 0, }], + + # This variable allows the user to customize the optimization level used + # by the compiler. The user should be aware that this has different + # meanings for different compilers and should exercise caution when + # overriding it. + [ 'skia_os == "win"', { + 'skia_release_optimization_level%': '<(skia_default_vs_optimization_level)', + }, { + 'skia_release_optimization_level%': '<(skia_default_gcc_optimization_level)', + }], ], # Re-define all variables defined within the level-2 'variables' dict, @@ -128,8 +143,6 @@ 'ios_sdk_version%': '6.0', 'skia_win_debuggers_path%': '<(skia_win_debuggers_path)', - 'skia_cros_target%': '', - # These are referenced by our .gypi files that list files (e.g. core.gypi) # 'skia_src_path%': '../src', |