diff --git a/gyp/CocoaDebuggerApp.gyp b/gyp/CocoaDebuggerApp.gyp index 904563c034..1960a670e0 100644 --- a/gyp/CocoaDebuggerApp.gyp +++ b/gyp/CocoaDebuggerApp.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/FileReaderApp.gyp b/gyp/FileReaderApp.gyp index 2ada993e44..2db992ff99 100644 --- a/gyp/FileReaderApp.gyp +++ b/gyp/FileReaderApp.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/SampleApp.gyp b/gyp/SampleApp.gyp index 50baa62eca..4e01526452 100644 --- a/gyp/SampleApp.gyp +++ b/gyp/SampleApp.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { @@ -158,9 +158,7 @@ 'VCLinkerTool': { 'SubSystem': '2', 'AdditionalDependencies': [ - 'OpenGL32.lib', - 'usp10.lib', - 'd3d9.lib', + 'd3d9.lib', ], }, }, diff --git a/gyp/SimpleCocoaApp.gyp b/gyp/SimpleCocoaApp.gyp index 68caa05f2e..9f415e4d11 100644 --- a/gyp/SimpleCocoaApp.gyp +++ b/gyp/SimpleCocoaApp.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/animator.gyp b/gyp/animator.gyp index d0d54aab40..fc61e712b5 100644 --- a/gyp/animator.gyp +++ b/gyp/animator.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/apptype_console.gypi b/gyp/apptype_console.gypi index b686fa71ef..8980ce8bba 100644 --- a/gyp/apptype_console.gypi +++ b/gyp/apptype_console.gypi @@ -10,11 +10,6 @@ #Console app, use main/wmain 'EntryPointSymbol': 'mainCRTStartup', - - 'AdditionalDependencies': [ - 'OpenGL32.lib', - 'usp10.lib', - ], }, }, }, diff --git a/gyp/bench.gyp b/gyp/bench.gyp index d5a4fcf781..11f0461556 100644 --- a/gyp/bench.gyp +++ b/gyp/bench.gyp @@ -9,7 +9,7 @@ { 'includes': [ 'apptype_console.gypi', - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/common.gypi b/gyp/common.gypi index 78482a05ed..d1f23d5758 100644 --- a/gyp/common.gypi +++ b/gyp/common.gypi @@ -12,10 +12,51 @@ # See the License for the specific language governing permissions and # limitations under the License. { - 'conditions' : [ - ['OS == "win"', - { - 'target_defaults': { + 'target_defaults': { + + # Define variables, and allow for override in GYP_DEFINES environment var. + 'variables': { + 'skia_scalar%': 'float', + }, + 'skia_scalar%': '<(skia_scalar)', + + 'configurations': { + 'Debug': { + 'defines': [ + 'SK_DEBUG', + 'GR_DEBUG=1', + ], + }, + 'Release': { + 'defines': [ + 'SK_RELEASE', + 'GR_RELEASE=1', + ], + }, + }, + + '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 + ], + } + ], + + ['OS == "win"', + { + 'defines': [ + 'SK_BUILD_FOR_WIN32', + 'SK_IGNORE_STDINT_DOT_H', + ], 'msvs_cygwin_shell': 0, 'msvs_settings': { 'VCCLCompilerTool': { @@ -24,6 +65,12 @@ 'DebugInformationFormat': '3', 'AdditionalOptions': '/MP', }, + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'OpenGL32.lib', + 'usp10.lib', + ], + }, }, 'configurations': { 'Debug': { @@ -52,11 +99,14 @@ }, }, }, - }, - ], - ['OS == "linux"', - { - 'target_defaults': { + ], + + ['OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', + { + 'defines': [ + 'SK_SAMPLES_FOR_X', + 'SK_BUILD_FOR_UNIX', + ], 'configurations': { 'Debug': { 'cflags': ['-g'] @@ -65,13 +115,18 @@ 'cflags': ['-O2'] }, }, - 'cflags': [ '-Wall', '-Wextra', '-Wno-unused' ] + 'cflags': [ '-Wall', '-Wextra', '-Wno-unused' ], + 'include_dirs' : [ + '/usr/include/freetype2', + ], }, - }, - ], - ['OS == "mac"', - { - 'target_defaults': { + ], + + ['OS == "mac"', + { + 'defines': [ + 'SK_BUILD_FOR_MAC', + ], 'configurations': { 'Debug': { 'cflags': ['-g'] @@ -80,13 +135,14 @@ 'cflags': ['-O2'] }, }, + 'xcode_settings': { + 'SYMROOT': '<(DEPTH)/xcodebuild', + }, }, - 'xcode_settings': { - 'SYMROOT': '<(DEPTH)/xcodebuild', - }, - }, - ], - ], + ], + + ], # end 'conditions' + }, # end 'target_defaults' } # Local Variables: # tab-width:2 diff --git a/gyp/core.gyp b/gyp/core.gyp index aa4877e9be..34d05c3357 100644 --- a/gyp/core.gyp +++ b/gyp/core.gyp @@ -1,7 +1,7 @@ # Core Skia library code. { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/effects.gyp b/gyp/effects.gyp index b6c253f1e0..3b6783833b 100644 --- a/gyp/effects.gyp +++ b/gyp/effects.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/experimental.gyp b/gyp/experimental.gyp index 171f4c8681..c5b8c5ea11 100644 --- a/gyp/experimental.gyp +++ b/gyp/experimental.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/gm.gyp b/gyp/gm.gyp index 2d6689153b..121999501a 100644 --- a/gyp/gm.gyp +++ b/gyp/gm.gyp @@ -2,7 +2,7 @@ { 'includes': [ 'apptype_console.gypi', - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/gpu.gyp b/gyp/gpu.gyp index dc157c58c0..787e0fc68d 100644 --- a/gyp/gpu.gyp +++ b/gyp/gpu.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/images.gyp b/gyp/images.gyp index 3608375b56..9627d3f59f 100644 --- a/gyp/images.gyp +++ b/gyp/images.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/libtess.gyp b/gyp/libtess.gyp index 6ea27d8491..4a776c3d9c 100644 --- a/gyp/libtess.gyp +++ b/gyp/libtess.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/opts.gyp b/gyp/opts.gyp index a93bf44c3e..42fb8aea4b 100644 --- a/gyp/opts.gyp +++ b/gyp/opts.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ # Due to an unfortunate intersection of lameness between gcc and gyp, diff --git a/gyp/pdf.gyp b/gyp/pdf.gyp index eb1dea01de..3957e481d6 100644 --- a/gyp/pdf.gyp +++ b/gyp/pdf.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/svg.gyp b/gyp/svg.gyp index 273ddec695..c72b99fcd6 100644 --- a/gyp/svg.gyp +++ b/gyp/svg.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/target_defaults.gypi b/gyp/target_defaults.gypi deleted file mode 100644 index 865f8a3c02..0000000000 --- a/gyp/target_defaults.gypi +++ /dev/null @@ -1,95 +0,0 @@ -{ - 'target_defaults': { - 'defines': [ - 'SK_CAN_USE_FLOAT', - ], - - 'variables': { - 'skia_scalar%': 'float', - }, - # Allow override in GYP_DEFINES environment variable. - 'skia_scalar%': '<(skia_scalar)', - - 'configurations': { - 'Debug': { - 'defines': [ - 'SK_DEBUG', - 'GR_DEBUG=1', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'GenerateDebugInformation': 'true', - }, - 'VCCLCompilerTool': { - #0 Disabled (/Od) - #1 Minimize Size (/O1) - #2 Maximize Speed (/O2) - #3 Full Optimization (/Ox) - 'Optimization': '0', - }, - }, - }, - 'Release': { - 'defines': [ - 'SK_RELEASE', - 'GR_RELEASE=1', - ], - }, - }, - 'conditions': [ - [ 'skia_scalar == "float"', - { - 'defines': [ - 'SK_SCALAR_IS_FLOAT', - ], - }, { # else, skia_scalar != "float" - 'defines': [ - 'SK_SCALAR_IS_FIXED', - ], - } - ], - [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', { - 'include_dirs' : [ - '/usr/include/freetype2', - ], - }], - [ 'OS == "mac"', { - 'defines': [ - 'SK_BUILD_FOR_MAC', - ], - }], - [ 'OS == "win"', { - 'defines': [ - 'SK_BUILD_FOR_WIN32', - 'SK_IGNORE_STDINT_DOT_H', - ], - }], - [ 'OS == "linux"', { - 'defines': [ - 'SK_SAMPLES_FOR_X', - 'SK_BUILD_FOR_UNIX', - ], - }], - ], - 'direct_dependent_settings': { - 'conditions': [ - [ 'OS == "mac"', { - 'defines': [ - 'SK_BUILD_FOR_MAC', - ], - }], - [ 'OS == "win"', { - 'defines': [ - 'SK_BUILD_FOR_WIN32', - ], - }], - ], - }, - }, -} - -# Local Variables: -# tab-width:2 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=2 shiftwidth=2: diff --git a/gyp/tests.gyp b/gyp/tests.gyp index d78a65a631..d4cafd2548 100644 --- a/gyp/tests.gyp +++ b/gyp/tests.gyp @@ -2,7 +2,7 @@ { 'includes': [ 'apptype_console.gypi', - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/tools.gyp b/gyp/tools.gyp index 939b32ac03..e0c04b4900 100644 --- a/gyp/tools.gyp +++ b/gyp/tools.gyp @@ -8,7 +8,7 @@ { 'includes': [ 'apptype_console.gypi', - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/utils.gyp b/gyp/utils.gyp index f0dcda9ea1..950f8034b5 100644 --- a/gyp/utils.gyp +++ b/gyp/utils.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/views.gyp b/gyp/views.gyp index 6ba42bf21f..4afa2afee4 100644 --- a/gyp/views.gyp +++ b/gyp/views.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/xml.gyp b/gyp/xml.gyp index 8e825ada7d..464a2a5e0b 100644 --- a/gyp/xml.gyp +++ b/gyp/xml.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp/zlib.gyp b/gyp/zlib.gyp index d47a13ee9c..44a8d2aa58 100644 --- a/gyp/zlib.gyp +++ b/gyp/zlib.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'target_defaults.gypi', + 'common.gypi', ], 'targets': [ { diff --git a/gyp_skia b/gyp_skia index 6a287730b5..ee8c17c2cc 100755 --- a/gyp_skia +++ b/gyp_skia @@ -53,9 +53,6 @@ def additional_include_files(args=[]): if os.path.realpath(path) not in specified_includes: result.append(path) - # Always include common.gypi - AddInclude(os.path.join(gyp_config_dir, 'common.gypi')) - return result if __name__ == '__main__':