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
diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi
index 9b44e41..3a42fdc 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',