aboutsummaryrefslogtreecommitdiffhomepage
path: root/gyp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-20 20:28:54 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-20 20:28:54 +0000
commit06b3864ce873d79a801b1cc433afe391bf23be12 (patch)
tree106abcfce04fb4b1b72511dedc20f48d33008ae9 /gyp
parent6fd531751228255812171fa7cf0a4018358fc291 (diff)
Add gyp define for optimization level
R=tomhudson@google.com, djsollen@google.com, epoger@google.com, bungeman@google.com Author: borenet@google.com Review URL: https://chromiumcodereview.appspot.com/17370005 git-svn-id: http://skia.googlecode.com/svn/trunk@9710 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gyp')
-rw-r--r--gyp/common_conditions.gypi11
-rw-r--r--gyp/common_variables.gypi17
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',