combine target_defaults.gypi into common.gypi

http://codereview.appspot.com/4654080



git-svn-id: http://skia.googlecode.com/svn/trunk@1780 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
epoger@google.com 2011-07-01 17:16:26 +00:00
parent 0c8d93a940
commit 5351b373b3
26 changed files with 100 additions and 149 deletions

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {
@ -158,9 +158,7 @@
'VCLinkerTool': { 'VCLinkerTool': {
'SubSystem': '2', 'SubSystem': '2',
'AdditionalDependencies': [ 'AdditionalDependencies': [
'OpenGL32.lib', 'd3d9.lib',
'usp10.lib',
'd3d9.lib',
], ],
}, },
}, },

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -10,11 +10,6 @@
#Console app, use main/wmain #Console app, use main/wmain
'EntryPointSymbol': 'mainCRTStartup', 'EntryPointSymbol': 'mainCRTStartup',
'AdditionalDependencies': [
'OpenGL32.lib',
'usp10.lib',
],
}, },
}, },
}, },

View File

@ -9,7 +9,7 @@
{ {
'includes': [ 'includes': [
'apptype_console.gypi', 'apptype_console.gypi',
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -12,10 +12,51 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
{ {
'conditions' : [ 'target_defaults': {
['OS == "win"',
{ # Define variables, and allow for override in GYP_DEFINES environment var.
'target_defaults': { '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_cygwin_shell': 0,
'msvs_settings': { 'msvs_settings': {
'VCCLCompilerTool': { 'VCCLCompilerTool': {
@ -24,6 +65,12 @@
'DebugInformationFormat': '3', 'DebugInformationFormat': '3',
'AdditionalOptions': '/MP', 'AdditionalOptions': '/MP',
}, },
'VCLinkerTool': {
'AdditionalDependencies': [
'OpenGL32.lib',
'usp10.lib',
],
},
}, },
'configurations': { 'configurations': {
'Debug': { 'Debug': {
@ -52,11 +99,14 @@
}, },
}, },
}, },
}, ],
],
['OS == "linux"', ['OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"',
{ {
'target_defaults': { 'defines': [
'SK_SAMPLES_FOR_X',
'SK_BUILD_FOR_UNIX',
],
'configurations': { 'configurations': {
'Debug': { 'Debug': {
'cflags': ['-g'] 'cflags': ['-g']
@ -65,13 +115,18 @@
'cflags': ['-O2'] 'cflags': ['-O2']
}, },
}, },
'cflags': [ '-Wall', '-Wextra', '-Wno-unused' ] 'cflags': [ '-Wall', '-Wextra', '-Wno-unused' ],
'include_dirs' : [
'/usr/include/freetype2',
],
}, },
}, ],
],
['OS == "mac"', ['OS == "mac"',
{ {
'target_defaults': { 'defines': [
'SK_BUILD_FOR_MAC',
],
'configurations': { 'configurations': {
'Debug': { 'Debug': {
'cflags': ['-g'] 'cflags': ['-g']
@ -80,13 +135,14 @@
'cflags': ['-O2'] 'cflags': ['-O2']
}, },
}, },
'xcode_settings': {
'SYMROOT': '<(DEPTH)/xcodebuild',
},
}, },
'xcode_settings': { ],
'SYMROOT': '<(DEPTH)/xcodebuild',
}, ], # end 'conditions'
}, }, # end 'target_defaults'
],
],
} }
# Local Variables: # Local Variables:
# tab-width:2 # tab-width:2

View File

@ -1,7 +1,7 @@
# Core Skia library code. # Core Skia library code.
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -2,7 +2,7 @@
{ {
'includes': [ 'includes': [
'apptype_console.gypi', 'apptype_console.gypi',
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
# Due to an unfortunate intersection of lameness between gcc and gyp, # Due to an unfortunate intersection of lameness between gcc and gyp,

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -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:

View File

@ -2,7 +2,7 @@
{ {
'includes': [ 'includes': [
'apptype_console.gypi', 'apptype_console.gypi',
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -8,7 +8,7 @@
{ {
'includes': [ 'includes': [
'apptype_console.gypi', 'apptype_console.gypi',
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -1,6 +1,6 @@
{ {
'includes': [ 'includes': [
'target_defaults.gypi', 'common.gypi',
], ],
'targets': [ 'targets': [
{ {

View File

@ -53,9 +53,6 @@ def additional_include_files(args=[]):
if os.path.realpath(path) not in specified_includes: if os.path.realpath(path) not in specified_includes:
result.append(path) result.append(path)
# Always include common.gypi
AddInclude(os.path.join(gyp_config_dir, 'common.gypi'))
return result return result
if __name__ == '__main__': if __name__ == '__main__':