aboutsummaryrefslogtreecommitdiffhomepage
path: root/gyp
diff options
context:
space:
mode:
authorGravatar seanpaul@google.com <seanpaul@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-09-15 14:24:33 +0000
committerGravatar seanpaul@google.com <seanpaul@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-09-15 14:24:33 +0000
commit1134f98165aa63be2f7c06ce465eae075eaceb56 (patch)
tree525a5a559c766e7694a08e00cf8b0629a52a26a2 /gyp
parentba72f042f6d3e8781e2ffa2de459731e19393adf (diff)
Refactor the bench and common gyp/gypi files to allow for building bench within
a chromium checkout (using chromium build configuration). BUG=362 TEST=Build bench from within the chromium and skia source tree, ensured it built and ran successfully. Review URL: http://codereview.appspot.com/5023042 git-svn-id: http://skia.googlecode.com/svn/trunk@2270 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gyp')
-rw-r--r--gyp/bench.gyp69
-rw-r--r--gyp/bench.gypi78
-rw-r--r--gyp/common.gypi161
-rw-r--r--gyp/common_conditions.gypi122
-rw-r--r--gyp/common_variables.gypi21
5 files changed, 244 insertions, 207 deletions
diff --git a/gyp/bench.gyp b/gyp/bench.gyp
index bae46f8d60..73472a57a0 100644
--- a/gyp/bench.gyp
+++ b/gyp/bench.gyp
@@ -9,36 +9,8 @@
{
'target_name': 'bench',
'type': 'executable',
- 'sources': [
- '../bench/benchmain.cpp',
- '../bench/BenchTimer.h',
- '../bench/BenchTimer.cpp',
- '../bench/BenchSysTimer_mach.h',
- '../bench/BenchSysTimer_mach.cpp',
- '../bench/BenchSysTimer_posix.h',
- '../bench/BenchSysTimer_posix.cpp',
- '../bench/BenchSysTimer_windows.h',
- '../bench/BenchSysTimer_windows.cpp',
- '../bench/BenchGpuTimer_gl.h',
- '../bench/BenchGpuTimer_gl.cpp',
- '../bench/BenchGpuTimer_none.h',
- '../bench/BenchGpuTimer_none.cpp',
-
- '../bench/SkBenchmark.h',
- '../bench/SkBenchmark.cpp',
-
- '../bench/BitmapBench.cpp',
- '../bench/BlurBench.cpp',
- '../bench/DecodeBench.cpp',
- '../bench/FPSBench.cpp',
- '../bench/GradientBench.cpp',
- '../bench/MathBench.cpp',
- '../bench/MatrixBench.cpp',
- '../bench/PathBench.cpp',
- '../bench/RectBench.cpp',
- '../bench/RepeatTileBench.cpp',
- '../bench/ScalarBench.cpp',
- '../bench/TextBench.cpp',
+ 'includes': [
+ 'bench.gypi'
],
'dependencies': [
'core.gyp:core',
@@ -48,43 +20,6 @@
'images.gyp:images',
'utils.gyp:utils',
],
- 'conditions': [
- [ 'skia_os != "mac"', {
- 'sources!': [
- '../bench/BenchSysTimer_mach.h',
- '../bench/BenchSysTimer_mach.cpp',
- ],
- }],
- [ 'skia_os not in ["linux", "freebsd", "openbsd", "solaris"]', {
- 'sources!': [
- '../bench/BenchSysTimer_posix.h',
- '../bench/BenchSysTimer_posix.cpp',
- ],
- },{
- 'link_settings': {
- 'libraries': [
- '-lrt',
- ],
- },
- }],
- [ 'skia_os != "win"', {
- 'sources!': [
- '../bench/BenchSysTimer_windows.h',
- '../bench/BenchSysTimer_windows.cpp',
- ],
- }],
- [ 'skia_os in ["win", "mac", "linux", "freebsd", "openbsd", "solaris"]', {
- 'sources!': [
- '../bench/BenchGpuTimer_none.h',
- '../bench/BenchGpuTimer_none.cpp',
- ],
- },{
- 'sources!': [
- '../bench/BenchGpuTimer_gl.h',
- '../bench/BenchGpuTimer_gl.cpp',
- ],
- }],
- ],
},
],
}
diff --git a/gyp/bench.gypi b/gyp/bench.gypi
new file mode 100644
index 0000000000..e84b6baa2a
--- /dev/null
+++ b/gyp/bench.gypi
@@ -0,0 +1,78 @@
+# sources and conditions used in skia's bench.gyp and chromium's skia.gyp
+#
+{
+ 'sources': [
+ '../bench/benchmain.cpp',
+ '../bench/BenchTimer.h',
+ '../bench/BenchTimer.cpp',
+ '../bench/BenchSysTimer_mach.h',
+ '../bench/BenchSysTimer_mach.cpp',
+ '../bench/BenchSysTimer_posix.h',
+ '../bench/BenchSysTimer_posix.cpp',
+ '../bench/BenchSysTimer_windows.h',
+ '../bench/BenchSysTimer_windows.cpp',
+ '../bench/BenchGpuTimer_gl.h',
+ '../bench/BenchGpuTimer_gl.cpp',
+ '../bench/BenchGpuTimer_none.h',
+ '../bench/BenchGpuTimer_none.cpp',
+
+ '../bench/SkBenchmark.h',
+ '../bench/SkBenchmark.cpp',
+
+ '../bench/BitmapBench.cpp',
+ '../bench/BlurBench.cpp',
+ '../bench/DecodeBench.cpp',
+ '../bench/FPSBench.cpp',
+ '../bench/GradientBench.cpp',
+ '../bench/MathBench.cpp',
+ '../bench/MatrixBench.cpp',
+ '../bench/PathBench.cpp',
+ '../bench/RectBench.cpp',
+ '../bench/RepeatTileBench.cpp',
+ '../bench/ScalarBench.cpp',
+ '../bench/TextBench.cpp',
+ ],
+ 'conditions': [
+ [ 'skia_os != "mac"', {
+ 'sources!': [
+ '../bench/BenchSysTimer_mach.h',
+ '../bench/BenchSysTimer_mach.cpp',
+ ],
+ }],
+ [ 'skia_os not in ["linux", "freebsd", "openbsd", "solaris"]', {
+ 'sources!': [
+ '../bench/BenchSysTimer_posix.h',
+ '../bench/BenchSysTimer_posix.cpp',
+ ],
+ },{
+ 'link_settings': {
+ 'libraries': [
+ '-lrt',
+ ],
+ },
+ }],
+ [ 'skia_os != "win"', {
+ 'sources!': [
+ '../bench/BenchSysTimer_windows.h',
+ '../bench/BenchSysTimer_windows.cpp',
+ ],
+ }],
+ [ 'skia_os in ["win", "mac", "linux", "freebsd", "openbsd", "solaris"]', {
+ 'sources!': [
+ '../bench/BenchGpuTimer_none.h',
+ '../bench/BenchGpuTimer_none.cpp',
+ ],
+ },{
+ 'sources!': [
+ '../bench/BenchGpuTimer_gl.h',
+ '../bench/BenchGpuTimer_gl.cpp',
+ ],
+ }],
+ ],
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/gyp/common.gypi b/gyp/common.gypi
index 64d54ba6ca..51d68e8778 100644
--- a/gyp/common.gypi
+++ b/gyp/common.gypi
@@ -3,18 +3,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
- # Define all variables, allowing for override in GYP_DEFINES.
- #
- # One such variable is 'skia_os', which we use instead of 'OS' throughout
- # our gyp files. We set it automatically based on 'OS', but allow the
- # user to override it via GYP_DEFINES if they like.
- 'variables': {
- 'skia_scalar%': 'float',
- 'skia_os%': '<(OS)',
- },
- 'skia_scalar%': '<(skia_scalar)',
- 'skia_os': '<(skia_os)',
-
+ 'includes': [
+ 'common_variables.gypi',
+ ],
'target_defaults': {
# Validate the 'skia_os' setting against 'OS', because only certain
@@ -26,7 +17,24 @@
{'error': '<!(Cannot build with skia_os=<(skia_os) on OS=<(OS))'}],
],
},
-
+ 'includes': [
+ 'common_conditions.gypi'
+ ],
+ 'conditions': [
+ [ 'skia_scalar == "float"',
+ {
+ 'defines': [
+ 'SK_SCALAR_IS_FLOAT',
+ 'SK_CAN_USE_FLOAT',
+ ],
+ }, { # else, skia_scalar != "float"
+ 'defines': [
+ 'SK_SCALAR_IS_FIXED',
+ 'SK_CAN_USE_FLOAT', # we can still use floats along the way
+ ],
+ }
+ ],
+ ],
'configurations': {
'Debug': {
'defines': [
@@ -41,133 +49,6 @@
],
},
},
-
- 'conditions' : [
-
- [ 'skia_scalar == "float"',
- {
- 'defines': [
- 'SK_SCALAR_IS_FLOAT',
- 'SK_CAN_USE_FLOAT',
- ],
- }, { # else, skia_scalar != "float"
- 'defines': [
- 'SK_SCALAR_IS_FIXED',
- 'SK_CAN_USE_FLOAT', # we can still use floats along the way
- ],
- }
- ],
-
- ['skia_os == "win"',
- {
- 'defines': [
- 'SK_BUILD_FOR_WIN32',
- 'SK_IGNORE_STDINT_DOT_H',
- ],
- 'msvs_cygwin_shell': 0,
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'WarningLevel': '1',
- 'WarnAsError': 'false',
- 'DebugInformationFormat': '3',
- 'AdditionalOptions': ['/MP',],
- },
- 'VCLinkerTool': {
- 'AdditionalDependencies': [
- 'OpenGL32.lib',
- 'usp10.lib',
- ],
- },
- },
- 'configurations': {
- 'Debug': {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'DebugInformationFormat': '1', # debugOldStyleInfo (/Z7)
- 'Optimization': '0', # optimizeDisabled (/Od)
- 'PreprocessorDefinitions': ['_DEBUG'],
- 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
- },
- 'VCLinkerTool': {
- 'GenerateDebugInformation': 'true',
- },
- },
- },
- 'Release': {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'DebugInformationFormat': '0', # debugDisabled
- 'Optimization': '2', # optimizeMaxSpeed (/O2)
- 'PreprocessorDefinitions': ['NDEBUG'],
- 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
- },
- 'VCLinkerTool': {
- 'GenerateDebugInformation': 'false',
- },
- },
- },
- },
- },
- ],
-
- ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
- {
- 'defines': [
- 'SK_SAMPLES_FOR_X',
- 'SK_BUILD_FOR_UNIX',
- ],
- 'configurations': {
- 'Debug': {
- 'cflags': ['-g']
- },
- 'Release': {
- 'cflags': ['-O2']
- },
- },
- 'cflags': [ '-Wall', '-Wextra', '-Wno-unused' ],
- 'include_dirs' : [
- '/usr/include/freetype2',
- ],
- },
- ],
-
- ['skia_os == "mac"',
- {
- 'defines': [
- 'SK_BUILD_FOR_MAC',
- ],
- 'configurations': {
- 'Debug': {
- 'xcode_settings': {
- 'GCC_OPTIMIZATION_LEVEL': '0',
- },
- },
- },
- 'xcode_settings': {
- 'SYMROOT': '<(DEPTH)/xcodebuild',
- },
- },
- ],
-
- ['skia_os == "ios"',
- {
- 'defines': [
- 'SK_BUILD_FOR_IOS',
- ],
- 'configurations': {
- 'Debug': {
- 'xcode_settings': {
- 'GCC_OPTIMIZATION_LEVEL': '0',
- },
- },
- },
- 'xcode_settings': {
- 'SYMROOT': '<(DEPTH)/xcodebuild',
- },
- },
- ],
-
- ], # end 'conditions'
}, # end 'target_defaults'
}
# Local Variables:
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
new file mode 100644
index 0000000000..2a49556118
--- /dev/null
+++ b/gyp/common_conditions.gypi
@@ -0,0 +1,122 @@
+# conditions used in both common.gypi and skia.gyp in chromium
+#
+{
+ 'conditions' : [
+
+ ['skia_os == "win"',
+ {
+ 'defines': [
+ 'SK_BUILD_FOR_WIN32',
+ 'SK_IGNORE_STDINT_DOT_H',
+ ],
+ 'msvs_cygwin_shell': 0,
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WarningLevel': '1',
+ 'WarnAsError': 'false',
+ 'DebugInformationFormat': '3',
+ 'AdditionalOptions': '/MP',
+ },
+ 'VCLinkerTool': {
+ 'AdditionalDependencies': [
+ 'OpenGL32.lib',
+ 'usp10.lib',
+ ],
+ },
+ },
+ 'configurations': {
+ 'Debug': {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '1', # debugOldStyleInfo (/Z7)
+ 'Optimization': '0', # optimizeDisabled (/Od)
+ 'PreprocessorDefinitions': ['_DEBUG'],
+ 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ },
+ },
+ },
+ 'Release': {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '0', # debugDisabled
+ 'Optimization': '2', # optimizeMaxSpeed (/O2)
+ 'PreprocessorDefinitions': ['NDEBUG'],
+ 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'false',
+ },
+ },
+ },
+ },
+ },
+ ],
+
+ ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
+ {
+ 'defines': [
+ 'SK_SAMPLES_FOR_X',
+ 'SK_BUILD_FOR_UNIX',
+ ],
+ 'configurations': {
+ 'Debug': {
+ 'cflags': ['-g']
+ },
+ 'Release': {
+ 'cflags': ['-O2']
+ },
+ },
+ 'cflags': [ '-Wall', '-Wextra', '-Wno-unused' ],
+ 'include_dirs' : [
+ '/usr/include/freetype2',
+ ],
+ },
+ ],
+
+ ['skia_os == "mac"',
+ {
+ 'defines': [
+ 'SK_BUILD_FOR_MAC',
+ ],
+ 'configurations': {
+ 'Debug': {
+ 'xcode_settings': {
+ 'GCC_OPTIMIZATION_LEVEL': '0',
+ },
+ },
+ },
+ 'xcode_settings': {
+ 'SYMROOT': '<(DEPTH)/xcodebuild',
+ },
+ },
+ ],
+
+ ['skia_os == "ios"',
+ {
+ 'defines': [
+ 'SK_BUILD_FOR_IOS',
+ ],
+ 'configurations': {
+ 'Debug': {
+ 'xcode_settings': {
+ 'GCC_OPTIMIZATION_LEVEL': '0',
+ },
+ },
+ },
+ 'xcode_settings': {
+ 'SYMROOT': '<(DEPTH)/xcodebuild',
+ },
+ },
+ ],
+
+ ], # end 'conditions'
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi
new file mode 100644
index 0000000000..5c27cc37c1
--- /dev/null
+++ b/gyp/common_variables.gypi
@@ -0,0 +1,21 @@
+# variables used in both common.gypi and skia.gyp in chromium
+#
+{
+ # Define all variables, allowing for override in GYP_DEFINES.
+ #
+ # One such variable is 'skia_os', which we use instead of 'OS' throughout
+ # our gyp files. We set it automatically based on 'OS', but allow the
+ # user to override it via GYP_DEFINES if they like.
+ 'variables': {
+ 'skia_scalar%': 'float',
+ 'skia_os%': '<(OS)',
+ },
+ 'skia_scalar%': '<(skia_scalar)',
+ 'skia_os': '<(skia_os)',
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2: