2015-03-25 17:22:41 +00:00
|
|
|
# Copyright 2015 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
2015-03-26 12:30:44 +00:00
|
|
|
|
2011-09-15 14:24:33 +00:00
|
|
|
# conditions used in both common.gypi and skia.gyp in chromium
|
|
|
|
#
|
|
|
|
{
|
2012-08-13 14:26:36 +00:00
|
|
|
'defines': [
|
|
|
|
'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)',
|
2013-11-20 18:06:10 +00:00
|
|
|
'SK_SUPPORT_GPU=<(skia_gpu)',
|
2014-11-07 15:12:46 +00:00
|
|
|
'SK_FORCE_DISTANCE_FIELD_TEXT=<(skia_force_distance_field_text)',
|
2016-08-01 16:22:12 +00:00
|
|
|
|
2016-05-06 14:21:26 +00:00
|
|
|
# Indicate that all dependency libraries are present. Clients that
|
|
|
|
# are missing some of the required decoding libraries may choose
|
|
|
|
# not to define these. This will disable some decoder and encoder
|
|
|
|
# features.
|
|
|
|
'SK_HAS_JPEG_LIBRARY',
|
|
|
|
'SK_HAS_PNG_LIBRARY',
|
|
|
|
'SK_HAS_WEBP_LIBRARY',
|
2012-08-13 14:26:36 +00:00
|
|
|
],
|
2011-09-15 14:24:33 +00:00
|
|
|
'conditions' : [
|
2016-03-02 22:44:15 +00:00
|
|
|
[ 'skia_is_bot', {
|
|
|
|
'defines': [ 'SK_IS_BOT' ],
|
|
|
|
}],
|
2016-02-02 19:56:33 +00:00
|
|
|
[ 'skia_codec_decodes_raw', {
|
|
|
|
'defines': [
|
|
|
|
'SK_CODEC_DECODES_RAW',
|
|
|
|
],
|
|
|
|
}],
|
2016-07-19 18:17:55 +00:00
|
|
|
[ 'skia_android_framework == 0', {
|
|
|
|
'defines': [
|
|
|
|
# Temporarily test against the QCMS library.
|
|
|
|
'SK_TEST_QCMS',
|
|
|
|
],
|
|
|
|
}],
|
2014-07-22 19:09:30 +00:00
|
|
|
['skia_pic', {
|
|
|
|
'cflags': [
|
|
|
|
'-fPIC',
|
|
|
|
],
|
|
|
|
'conditions' : [
|
|
|
|
# FIXME: The reason we don't do this on Android is due to the way
|
|
|
|
# we build the executables/skia_launcher on Android. See
|
|
|
|
# https://codereview.chromium.org/406613003/diff/1/gyp/common_conditions.gypi#newcode455
|
|
|
|
['skia_os != "android"', {
|
|
|
|
'target_conditions': [
|
|
|
|
[ '_type == "executable"', {
|
|
|
|
'cflags': [ '-fPIE' ],
|
|
|
|
'ldflags': [ '-pie' ],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
}],
|
2014-04-02 15:03:56 +00:00
|
|
|
|
2014-05-20 19:02:55 +00:00
|
|
|
# As of M35, Chrome requires SSE2 on x86 (and SSSE3 on Mac).
|
|
|
|
[ 'skia_arch_type == "x86"', {
|
|
|
|
'cflags': [
|
|
|
|
'-msse2',
|
|
|
|
'-mfpmath=sse',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
|
2013-03-22 13:16:06 +00:00
|
|
|
[ 'skia_os == "win"',
|
2011-09-15 14:24:33 +00:00
|
|
|
{
|
|
|
|
'defines': [
|
2011-09-28 14:32:01 +00:00
|
|
|
'_CRT_SECURE_NO_WARNINGS',
|
2015-07-21 21:14:30 +00:00
|
|
|
'_HAS_EXCEPTIONS=0',
|
2016-06-10 13:42:45 +00:00
|
|
|
'WIN32_LEAN_AND_MEAN',
|
|
|
|
'NOMINMAX',
|
2011-09-15 14:24:33 +00:00
|
|
|
],
|
2014-05-07 19:56:27 +00:00
|
|
|
'msvs_disabled_warnings': [
|
2014-09-10 14:49:05 +00:00
|
|
|
4275, # An exported class was derived from a class that was not exported
|
|
|
|
4345, # This is an FYI about a behavior change from long ago. Chrome stifles it too.
|
|
|
|
4355, # 'this' used in base member initializer list. Off by default in newer compilers.
|
2014-05-07 19:56:27 +00:00
|
|
|
],
|
2011-09-15 14:24:33 +00:00
|
|
|
'msvs_cygwin_shell': 0,
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
2013-03-21 20:29:05 +00:00
|
|
|
'WarningLevel': '3',
|
|
|
|
'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
|
2011-09-15 14:24:33 +00:00
|
|
|
'DebugInformationFormat': '3',
|
2013-03-21 20:29:05 +00:00
|
|
|
'ExceptionHandling': '0',
|
|
|
|
'AdditionalOptions': [ '/MP', ],
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
'VCLinkerTool': {
|
2014-04-30 20:47:22 +00:00
|
|
|
'LargeAddressAware': 2, # 2 means "Yes, please let me use more RAM on 32-bit builds."
|
2011-09-15 14:24:33 +00:00
|
|
|
'AdditionalDependencies': [
|
|
|
|
'OpenGL32.lib',
|
|
|
|
'usp10.lib',
|
2013-06-05 18:35:22 +00:00
|
|
|
|
|
|
|
# Prior to gyp r1584, the following were included automatically.
|
|
|
|
'kernel32.lib',
|
|
|
|
'gdi32.lib',
|
|
|
|
'winspool.lib',
|
|
|
|
'comdlg32.lib',
|
|
|
|
'advapi32.lib',
|
|
|
|
'shell32.lib',
|
|
|
|
'ole32.lib',
|
|
|
|
'oleaut32.lib',
|
|
|
|
'user32.lib',
|
|
|
|
'uuid.lib',
|
|
|
|
'odbc32.lib',
|
|
|
|
'odbccp32.lib',
|
2013-06-06 18:34:13 +00:00
|
|
|
'DelayImp.lib',
|
2011-09-15 14:24:33 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'configurations': {
|
|
|
|
'Debug': {
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
2011-09-28 14:32:01 +00:00
|
|
|
'DebugInformationFormat': '4', # editAndContiue (/ZI)
|
2011-09-15 14:24:33 +00:00
|
|
|
'Optimization': '0', # optimizeDisabled (/Od)
|
|
|
|
'PreprocessorDefinitions': ['_DEBUG'],
|
|
|
|
'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
|
2011-09-28 14:32:01 +00:00
|
|
|
'RuntimeTypeInfo': 'false', # /GR-
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
'VCLinkerTool': {
|
2011-09-28 14:32:01 +00:00
|
|
|
'GenerateDebugInformation': 'true', # /DEBUG
|
|
|
|
'LinkIncremental': '2', # /INCREMENTAL
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'Release': {
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
2012-05-31 14:12:46 +00:00
|
|
|
'DebugInformationFormat': '3', # programDatabase (/Zi)
|
2013-06-20 20:28:54 +00:00
|
|
|
'Optimization': '<(skia_release_optimization_level)',
|
2011-09-28 14:32:01 +00:00
|
|
|
# Changing the floating point model requires rebaseling gm images
|
2012-05-31 14:12:46 +00:00
|
|
|
#'FloatingPointModel': '2', # fast (/fp:fast)
|
|
|
|
'FavorSizeOrSpeed': '1', # speed (/Ot)
|
2011-09-15 14:24:33 +00:00
|
|
|
'PreprocessorDefinitions': ['NDEBUG'],
|
2012-05-31 14:12:46 +00:00
|
|
|
'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
|
|
|
|
'EnableEnhancedInstructionSet': '2',# /arch:SSE2
|
|
|
|
'RuntimeTypeInfo': 'false', # /GR-
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
'VCLinkerTool': {
|
2011-09-28 14:32:01 +00:00
|
|
|
'GenerateDebugInformation': 'true', # /DEBUG
|
2011-10-03 19:36:51 +00:00
|
|
|
},
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
},
|
2014-04-22 20:05:35 +00:00
|
|
|
},
|
|
|
|
'conditions' : [
|
2014-04-01 07:02:41 +00:00
|
|
|
# Gyp's ninja generator depends on these specially named
|
|
|
|
# configurations to build 64-bit on Windows.
|
2015-11-07 13:29:00 +00:00
|
|
|
# See https://bug.skia.org/2348
|
2014-04-01 07:02:41 +00:00
|
|
|
#
|
|
|
|
# We handle the 64- vs 32-bit variations elsewhere, so I think it's
|
|
|
|
# OK for us to just make these inherit non-archwidth-specific
|
|
|
|
# configurations without modification.
|
2014-04-22 20:05:35 +00:00
|
|
|
#
|
2015-11-07 13:29:00 +00:00
|
|
|
# See https://bug.skia.org/2442 : These targets cause problems in the
|
2014-04-22 20:05:35 +00:00
|
|
|
# MSVS build, so only include them if gyp is generating a ninja build.
|
|
|
|
[ '"ninja" in "<!(echo %GYP_GENERATORS%)"', {
|
|
|
|
'configurations': {
|
|
|
|
'Debug_x64': {
|
|
|
|
'inherit_from': ['Debug'],
|
2014-11-13 21:47:06 +00:00
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
|
|
|
# /ZI is not supported on 64bit
|
|
|
|
'DebugInformationFormat': '3', # programDatabase (/Zi)
|
|
|
|
},
|
|
|
|
},
|
2014-04-22 20:05:35 +00:00
|
|
|
},
|
|
|
|
'Release_x64': {
|
|
|
|
'inherit_from': ['Release'],
|
2014-11-19 16:59:58 +00:00
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
|
|
|
# Don't specify /arch. SSE2 is implied by 64bit and specifying it warns.
|
|
|
|
'EnableEnhancedInstructionSet': '0', #
|
|
|
|
},
|
|
|
|
},
|
2014-04-22 20:05:35 +00:00
|
|
|
},
|
|
|
|
'Release_Developer_x64': {
|
|
|
|
'inherit_from': ['Release_Developer'],
|
2014-11-19 16:59:58 +00:00
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
|
|
|
# Don't specify /arch. SSE2 is implied by 64bit and specifying it warns.
|
|
|
|
'EnableEnhancedInstructionSet': '0', #
|
|
|
|
},
|
|
|
|
},
|
2014-04-22 20:05:35 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}],
|
2015-07-27 13:10:36 +00:00
|
|
|
[ 'skia_arch_type == "x86_64"', {
|
2013-01-08 20:40:22 +00:00
|
|
|
'msvs_configuration_platform': 'x64',
|
2013-03-22 13:16:06 +00:00
|
|
|
}],
|
2015-07-27 13:10:36 +00:00
|
|
|
[ 'skia_arch_type == "x86"', {
|
2013-03-22 13:16:06 +00:00
|
|
|
'msvs_configuration_platform': 'Win32',
|
|
|
|
}],
|
|
|
|
[ 'skia_warnings_as_errors', {
|
2013-01-08 20:40:22 +00:00
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
2013-03-22 13:16:06 +00:00
|
|
|
'WarnAsError': 'true',
|
|
|
|
'AdditionalOptions': [
|
|
|
|
'/we4189', # initialized but unused var warning
|
2016-02-09 17:14:28 +00:00
|
|
|
'/we4238', # taking address of rvalue
|
|
|
|
'/we4239', # assigning rvalues to non-const lvalues
|
2013-03-22 13:16:06 +00:00
|
|
|
],
|
2013-01-08 20:40:22 +00:00
|
|
|
},
|
|
|
|
},
|
2012-08-20 18:58:26 +00:00
|
|
|
}],
|
2013-06-14 17:10:09 +00:00
|
|
|
[ 'skia_win_exceptions', {
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
|
|
|
'AdditionalOptions': [
|
|
|
|
'/EHsc',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}],
|
2014-06-26 19:56:28 +00:00
|
|
|
[ 'skia_win_ltcg', {
|
|
|
|
'configurations': {
|
|
|
|
'Release': {
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
|
|
|
'WholeProgramOptimization': 'true', #/GL
|
|
|
|
},
|
|
|
|
'VCLinkerTool': {
|
|
|
|
'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
|
|
|
|
},
|
|
|
|
'VCLibrarianTool': {
|
|
|
|
'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}],
|
2012-08-20 18:58:26 +00:00
|
|
|
],
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
|
2013-07-11 12:48:14 +00:00
|
|
|
# The following section is common to linux + derivatives and android
|
2016-04-29 21:01:34 +00:00
|
|
|
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "android"]',
|
2013-07-11 12:48:14 +00:00
|
|
|
{
|
2013-11-20 15:13:49 +00:00
|
|
|
'cflags': [
|
2013-11-20 18:06:10 +00:00
|
|
|
'-g',
|
2013-11-20 15:13:49 +00:00
|
|
|
'-fno-exceptions',
|
|
|
|
'-fstrict-aliasing',
|
2013-11-20 18:06:10 +00:00
|
|
|
|
2013-11-20 15:13:49 +00:00
|
|
|
'-Wall',
|
|
|
|
'-Wextra',
|
|
|
|
'-Winit-self',
|
|
|
|
'-Wpointer-arith',
|
2015-01-23 15:01:26 +00:00
|
|
|
'-Wsign-compare',
|
2016-06-15 16:13:50 +00:00
|
|
|
'-Wvla',
|
2013-11-20 15:13:49 +00:00
|
|
|
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
],
|
|
|
|
'cflags_cc': [
|
2015-02-05 17:23:56 +00:00
|
|
|
'-std=c++11',
|
2013-11-20 15:13:49 +00:00
|
|
|
'-fno-rtti',
|
2015-09-09 17:46:20 +00:00
|
|
|
'-fno-threadsafe-statics',
|
2013-11-20 15:13:49 +00:00
|
|
|
'-Wnon-virtual-dtor',
|
|
|
|
],
|
2016-03-07 19:05:15 +00:00
|
|
|
'ldflags': [ '-rdynamic' ],
|
2013-07-11 12:48:14 +00:00
|
|
|
'conditions': [
|
2015-03-26 12:30:44 +00:00
|
|
|
[ 'skia_fast', { 'cflags': [ '<@(skia_fast_flags)' ] }],
|
2016-04-29 21:01:34 +00:00
|
|
|
[ 'skia_arch_type == "x86_64" and not skia_android_framework', {
|
|
|
|
'cflags': [
|
|
|
|
'-m64',
|
|
|
|
],
|
|
|
|
'ldflags': [
|
|
|
|
'-m64',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
[ 'skia_arch_type == "x86" and not skia_android_framework', {
|
|
|
|
'cflags': [
|
|
|
|
'-m32',
|
|
|
|
],
|
|
|
|
'ldflags': [
|
|
|
|
'-m32',
|
2014-07-07 16:47:24 +00:00
|
|
|
],
|
|
|
|
}],
|
2013-07-11 12:48:14 +00:00
|
|
|
[ 'skia_warnings_as_errors', {
|
|
|
|
'cflags': [
|
|
|
|
'-Werror',
|
|
|
|
],
|
|
|
|
}],
|
2014-02-13 18:36:36 +00:00
|
|
|
# For profiling; reveals some costs, exaggerates others (e.g. trivial setters & getters).
|
|
|
|
[ 'skia_disable_inlining', {
|
|
|
|
'cflags': [
|
|
|
|
'-fno-inline',
|
|
|
|
'-fno-default-inline',
|
|
|
|
'-finline-limit=0',
|
|
|
|
'-fno-omit-frame-pointer',
|
|
|
|
],
|
|
|
|
}],
|
2013-07-31 12:57:27 +00:00
|
|
|
[ 'skia_arch_type == "arm" and arm_version >= 7', {
|
2013-07-11 12:48:14 +00:00
|
|
|
'cflags': [
|
|
|
|
'-march=armv7-a',
|
2015-04-02 17:47:57 +00:00
|
|
|
'-mthumb',
|
2013-07-11 12:48:14 +00:00
|
|
|
],
|
2013-07-31 12:57:27 +00:00
|
|
|
'ldflags': [
|
|
|
|
'-march=armv7-a',
|
|
|
|
],
|
2013-07-11 12:48:14 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'arm_neon == 1', {
|
|
|
|
'defines': [
|
2014-08-01 12:32:32 +00:00
|
|
|
'SK_ARM_HAS_NEON',
|
2013-07-11 12:48:14 +00:00
|
|
|
],
|
|
|
|
'cflags': [
|
|
|
|
'-mfpu=neon',
|
|
|
|
],
|
|
|
|
}],
|
2016-04-29 21:01:34 +00:00
|
|
|
[ 'skia_os != "linux"', {
|
2013-07-11 18:46:30 +00:00
|
|
|
'cflags': [
|
|
|
|
'-mfloat-abi=softfp',
|
|
|
|
],
|
|
|
|
}],
|
2013-07-11 12:48:14 +00:00
|
|
|
],
|
|
|
|
}],
|
2015-07-27 13:10:36 +00:00
|
|
|
[ '"mips" in skia_arch_type', {
|
2016-06-05 20:14:21 +00:00
|
|
|
'target_conditions': [
|
|
|
|
[ '_toolset == "target"', {
|
|
|
|
'cflags' : ['-EL'],
|
|
|
|
'conditions' : [
|
|
|
|
[ 'mips_arch_variant == "mips32r2"', {
|
|
|
|
'cflags': [ '-march=mips32r2' ],
|
|
|
|
'conditions': [
|
|
|
|
[ 'mips_dsp == 1', { 'cflags': [ '-mdsp' ] }],
|
|
|
|
[ 'mips_dsp == 2', { 'cflags': [ '-mdspr2' ] }],
|
|
|
|
],
|
|
|
|
}],
|
2014-06-06 21:09:12 +00:00
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
}],
|
2013-07-11 12:48:14 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
2014-02-05 16:35:12 +00:00
|
|
|
['skia_android_framework', {
|
|
|
|
'cflags': [
|
|
|
|
# Skia does not enforce this usage pattern so we disable it here to avoid
|
|
|
|
# unecessary log spew when building
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
|
|
|
|
# Android's -D_FORTIFY_SOURCE=2 extensions are incompatibile with SkString.
|
|
|
|
# Revert to -D_FORTIFY_SOURCE=1
|
|
|
|
'-U_FORTIFY_SOURCE',
|
|
|
|
'-D_FORTIFY_SOURCE=1',
|
2015-01-27 17:01:01 +00:00
|
|
|
|
2015-08-14 17:03:45 +00:00
|
|
|
# We can't use the skia_shared_lib gyp setting because we need to
|
2015-01-27 17:01:01 +00:00
|
|
|
# isolate this define to Skia sources. CFLAGS are local to Android.mk
|
|
|
|
# and ensures that this define is not exported to clients of the library
|
|
|
|
'-DSKIA_IMPLEMENTATION=1',
|
2014-02-05 16:35:12 +00:00
|
|
|
],
|
2014-03-25 15:14:18 +00:00
|
|
|
# Remove flags which are either unnecessary or problematic for the
|
|
|
|
# Android framework build. Many of these flags are removed simply because
|
|
|
|
# they were not previously in the Android framework makefile, and we did
|
|
|
|
# did not intend to add them when generating the makefile.
|
|
|
|
# TODO (scroggo): Investigate whether any of these flags are actually
|
|
|
|
# needed/would be beneficial.
|
2014-02-28 16:07:39 +00:00
|
|
|
'cflags!': [
|
2014-03-25 15:14:18 +00:00
|
|
|
# Android has one makefile, used for both debugging (after manual
|
|
|
|
# modification) and release. Turn off debug info by default.
|
2014-02-28 16:07:39 +00:00
|
|
|
'-g',
|
|
|
|
'-march=armv7-a',
|
|
|
|
'-mthumb',
|
|
|
|
'-mfpu=neon',
|
|
|
|
'-mfloat-abi=softfp',
|
2014-03-25 15:14:18 +00:00
|
|
|
'-fno-exceptions',
|
|
|
|
'-fstrict-aliasing',
|
|
|
|
# Remove flags to turn on warnings, since most people building Android
|
|
|
|
# are not focused on Skia and do not need the extra warning info.
|
|
|
|
'-Wall',
|
|
|
|
'-Wextra',
|
|
|
|
'-Winit-self',
|
|
|
|
'-Wpointer-arith',
|
2015-01-23 15:01:26 +00:00
|
|
|
'-Wsign-compare',
|
2014-03-25 15:14:18 +00:00
|
|
|
],
|
|
|
|
'cflags_cc!': [
|
|
|
|
'-fno-rtti',
|
|
|
|
'-Wnon-virtual-dtor',
|
2014-02-28 16:07:39 +00:00
|
|
|
],
|
2014-02-05 16:35:12 +00:00
|
|
|
'defines': [
|
|
|
|
'DCT_IFAST_SUPPORTED',
|
|
|
|
# using freetype's embolden allows us to adjust fake bold settings at
|
|
|
|
# draw-time, at which point we know which SkTypeface is being drawn
|
|
|
|
'SK_USE_FREETYPE_EMBOLDEN',
|
2014-03-28 15:59:04 +00:00
|
|
|
# When built as part of the system image we can enable certian non-NDK
|
|
|
|
# compliant optimizations.
|
|
|
|
'SK_BUILD_FOR_ANDROID_FRAMEWORK',
|
|
|
|
# Optimizations for chromium (m30)
|
|
|
|
'GR_GL_CUSTOM_SETUP_HEADER "gl/GrGLConfig_chrome.h"',
|
|
|
|
'SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)',
|
2014-05-28 21:44:05 +00:00
|
|
|
'SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)',
|
2014-06-02 20:51:34 +00:00
|
|
|
'SK_IGNORE_ETC1_SUPPORT',
|
2015-08-14 17:03:45 +00:00
|
|
|
# We can't use the skia_shared_lib gyp setting because we need expose
|
2015-01-27 17:01:01 +00:00
|
|
|
# this define globally and the the implemention define as a cflag.
|
|
|
|
'SKIA_DLL',
|
2015-03-26 14:15:55 +00:00
|
|
|
'SK_PRINT_CODEC_MESSAGES',
|
2015-07-22 20:29:25 +00:00
|
|
|
],
|
|
|
|
}],
|
|
|
|
|
|
|
|
['skia_use_android_framework_defines', {
|
|
|
|
# Add these defines when building for the Android framework, or when
|
|
|
|
# specifically requested. These should be temporary staging defines. Any
|
|
|
|
# permanent defines should be moved into the skia_android_framework block
|
|
|
|
# above.
|
|
|
|
'includes' : [
|
|
|
|
'skia_for_android_framework_defines.gypi',
|
|
|
|
],
|
|
|
|
'defines': [
|
2014-05-30 21:53:01 +00:00
|
|
|
'<@(skia_for_android_framework_defines)',
|
2014-02-05 16:35:12 +00:00
|
|
|
],
|
|
|
|
}],
|
2015-11-12 16:41:40 +00:00
|
|
|
|
2015-11-09 20:30:05 +00:00
|
|
|
[ 'skia_use_sdl == 1',
|
|
|
|
{
|
|
|
|
'defines': [ 'SK_USE_SDL' ],
|
|
|
|
}],
|
2013-07-11 12:48:14 +00:00
|
|
|
|
2015-12-02 21:00:37 +00:00
|
|
|
[ 'skia_dump_stats == 1',
|
|
|
|
{
|
|
|
|
'defines': [ 'SK_DUMP_STATS'],
|
|
|
|
}],
|
|
|
|
|
2016-04-29 21:01:34 +00:00
|
|
|
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
|
2011-09-15 14:24:33 +00:00
|
|
|
{
|
|
|
|
'defines': [
|
|
|
|
'SK_SAMPLES_FOR_X',
|
|
|
|
'SK_BUILD_FOR_UNIX',
|
|
|
|
],
|
|
|
|
'configurations': {
|
2013-09-13 19:32:43 +00:00
|
|
|
'Coverage': {
|
2015-07-06 14:43:58 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'skia_clang_build', {
|
|
|
|
'cflags': ['-fprofile-instr-generate', '-fcoverage-mapping'],
|
|
|
|
'ldflags': ['-fprofile-instr-generate', '-fcoverage-mapping'],
|
|
|
|
}, {
|
|
|
|
'cflags': ['--coverage'],
|
|
|
|
'ldflags': ['--coverage'],
|
|
|
|
}],
|
|
|
|
],
|
2013-09-13 19:32:43 +00:00
|
|
|
},
|
2011-09-15 14:24:33 +00:00
|
|
|
'Debug': {
|
|
|
|
},
|
|
|
|
'Release': {
|
2013-06-20 20:28:54 +00:00
|
|
|
'cflags': [
|
|
|
|
'-O<(skia_release_optimization_level)',
|
|
|
|
],
|
2012-01-19 19:59:22 +00:00
|
|
|
'defines': [ 'NDEBUG' ],
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
},
|
2012-08-09 20:44:32 +00:00
|
|
|
'conditions' : [
|
2013-06-20 17:15:05 +00:00
|
|
|
[ 'skia_shared_lib', {
|
|
|
|
'defines': [
|
|
|
|
'SKIA_DLL',
|
|
|
|
'SKIA_IMPLEMENTATION=1',
|
|
|
|
],
|
|
|
|
}],
|
2013-10-08 15:16:36 +00:00
|
|
|
# Enable asan, tsan, etc.
|
|
|
|
[ 'skia_sanitizer', {
|
2015-12-09 20:39:01 +00:00
|
|
|
'cflags_cc!': [ '-fno-rtti' ], # vptr needs rtti
|
2013-07-03 15:55:05 +00:00
|
|
|
'cflags': [
|
2015-12-08 22:26:17 +00:00
|
|
|
'-fsanitize=<(skia_sanitizer)', # Turn on sanitizers.
|
|
|
|
'-fno-sanitize-recover=<(skia_sanitizer)', # Make any failure fatal.
|
|
|
|
'-fsanitize-blacklist=<(skia_sanitizer_blacklist)', # Compile in our blacklist.
|
|
|
|
'-include <(skia_sanitizer_blacklist)', # Make every .cpp depend on it.
|
2013-07-03 15:55:05 +00:00
|
|
|
],
|
2015-12-09 20:39:01 +00:00
|
|
|
'ldflags': [ '-fsanitize=<(skia_sanitizer)' ],
|
2013-10-09 16:12:23 +00:00
|
|
|
'conditions' : [
|
2016-02-07 03:12:23 +00:00
|
|
|
[ 'skia_sanitizer == "memory"', {
|
2016-02-07 17:12:29 +00:00
|
|
|
'cflags': [
|
|
|
|
'-O1',
|
|
|
|
'-fsanitize-memory-track-origins',
|
|
|
|
],
|
2016-02-07 03:12:23 +00:00
|
|
|
}],
|
2013-10-09 16:12:23 +00:00
|
|
|
],
|
2013-09-25 22:39:22 +00:00
|
|
|
}],
|
2013-08-21 18:02:50 +00:00
|
|
|
[ 'skia_clang_build', {
|
2014-06-30 19:33:11 +00:00
|
|
|
'cflags_cc': [
|
|
|
|
'-Wno-unknown-warning-option', # Allows unknown warnings.
|
|
|
|
'-Wno-deprecated', # From Qt, via debugger (older Clang).
|
|
|
|
'-Wno-deprecated-register', # From Qt, via debugger (newer Clang).
|
|
|
|
],
|
2013-08-21 18:02:50 +00:00
|
|
|
'cflags': [
|
2014-06-30 19:33:11 +00:00
|
|
|
# Extra warnings we like but that only Clang knows about.
|
|
|
|
'-Wstring-conversion',
|
2013-08-21 18:02:50 +00:00
|
|
|
],
|
2014-05-20 19:42:03 +00:00
|
|
|
'cflags!': [
|
|
|
|
'-mfpmath=sse', # Clang doesn't need to be told this, and sometimes gets confused.
|
|
|
|
],
|
2013-08-21 18:02:50 +00:00
|
|
|
}],
|
2013-10-25 18:14:54 +00:00
|
|
|
[ 'skia_keep_frame_pointer', {
|
|
|
|
'cflags': [ '-fno-omit-frame-pointer' ],
|
|
|
|
}],
|
2011-09-15 14:24:33 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
2013-03-22 13:16:06 +00:00
|
|
|
[ 'skia_os == "mac"',
|
2011-09-15 14:24:33 +00:00
|
|
|
{
|
2014-08-19 20:32:59 +00:00
|
|
|
'defines': [ 'SK_BUILD_FOR_MAC' ],
|
2015-10-28 15:42:29 +00:00
|
|
|
'conditions': [
|
|
|
|
# ANGLE for mac hits -Wunneeded-internal-declaration if this isn't set.
|
|
|
|
[ 'skia_angle', { 'defines': [ 'YY_NO_INPUT' ], } ],
|
|
|
|
],
|
2011-09-15 14:24:33 +00:00
|
|
|
'configurations': {
|
2013-11-21 17:04:29 +00:00
|
|
|
'Coverage': {
|
|
|
|
'xcode_settings': {
|
|
|
|
'GCC_OPTIMIZATION_LEVEL': '0',
|
|
|
|
'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',
|
|
|
|
'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS' : 'YES',
|
|
|
|
},
|
|
|
|
},
|
2011-09-15 14:24:33 +00:00
|
|
|
'Debug': {
|
2014-08-19 20:32:59 +00:00
|
|
|
'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '0' },
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
2011-10-10 14:19:40 +00:00
|
|
|
'Release': {
|
2014-08-19 20:32:59 +00:00
|
|
|
'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)', },
|
2012-01-19 19:59:22 +00:00
|
|
|
'defines': [ 'NDEBUG' ],
|
2011-10-10 14:19:40 +00:00
|
|
|
},
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
'xcode_settings': {
|
2014-01-20 16:14:02 +00:00
|
|
|
'conditions': [
|
2015-03-26 12:30:44 +00:00
|
|
|
[ 'skia_fast', { 'WARNING_CFLAGS': [ '<@(skia_fast_flags)' ] } ],
|
2014-08-19 20:32:59 +00:00
|
|
|
[ 'skia_warnings_as_errors', { 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES' }],
|
2015-07-27 13:10:36 +00:00
|
|
|
[ 'skia_arch_type == "x86"', { 'ARCHS': ['i386'] }],
|
|
|
|
[ 'skia_arch_type == "x86_64"', { 'ARCHS': ['x86_64'] }],
|
2014-01-20 16:14:02 +00:00
|
|
|
[ 'skia_osx_deployment_target==""', {
|
2015-11-12 16:41:40 +00:00
|
|
|
'MACOSX_DEPLOYMENT_TARGET': '10.7', # -mmacos-version-min, passed in env to ld.
|
2014-01-20 16:14:02 +00:00
|
|
|
}, {
|
|
|
|
'MACOSX_DEPLOYMENT_TARGET': '<(skia_osx_deployment_target)',
|
|
|
|
}],
|
2015-12-09 20:39:01 +00:00
|
|
|
[ 'skia_sanitizer', {
|
2016-02-03 21:06:28 +00:00
|
|
|
'GCC_ENABLE_CPP_RTTI': 'YES', # vptr needs rtti
|
2015-12-09 20:39:01 +00:00
|
|
|
'OTHER_CFLAGS': [
|
|
|
|
'-fsanitize=<(skia_sanitizer)', # Turn on sanitizers.
|
|
|
|
'-fno-sanitize-recover=<(skia_sanitizer)', # Make any failure fatal.
|
|
|
|
'-fsanitize-blacklist=<(skia_sanitizer_blacklist)', # Compile in our blacklist.
|
|
|
|
'-include <(skia_sanitizer_blacklist)', # Make every .cpp depend on it.
|
|
|
|
],
|
|
|
|
# We want to pass -fsanitize=... to our final link call,
|
|
|
|
# but not to libtool. OTHER_LDFLAGS is passed to both.
|
|
|
|
# To trick GYP into doing what we want, we'll piggyback on
|
|
|
|
# LIBRARY_SEARCH_PATHS, producing "-L/usr/lib -fsanitize=...".
|
|
|
|
# The -L/usr/lib is redundant but innocuous: it's a default path.
|
|
|
|
'LIBRARY_SEARCH_PATHS': [ '/usr/lib -fsanitize=<(skia_sanitizer)'],
|
|
|
|
}],
|
2014-01-20 16:14:02 +00:00
|
|
|
],
|
2015-11-12 16:41:40 +00:00
|
|
|
'CLANG_CXX_LIBRARY': 'libc++',
|
2016-02-03 21:06:28 +00:00
|
|
|
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
|
|
|
|
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
|
|
|
|
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
|
|
|
|
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
|
|
|
|
'GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS': 'YES', # -mssse3
|
2016-03-28 19:43:39 +00:00
|
|
|
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
|
|
|
|
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden
|
2014-10-13 19:32:34 +00:00
|
|
|
'GCC_CW_ASM_SYNTAX': 'NO', # remove -fasm-blocks
|
|
|
|
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # remove -mpascal-strings
|
2016-02-03 21:06:28 +00:00
|
|
|
'WARNING_CFLAGS': [
|
|
|
|
'-Wall',
|
|
|
|
'-Wextra',
|
|
|
|
'-Winit-self',
|
|
|
|
'-Wpointer-arith',
|
|
|
|
'-Wsign-compare',
|
2016-06-15 16:13:50 +00:00
|
|
|
'-Wvla',
|
2016-02-03 21:06:28 +00:00
|
|
|
|
|
|
|
'-Wno-unused-parameter',
|
2012-10-02 15:42:21 +00:00
|
|
|
],
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
2013-03-22 13:16:06 +00:00
|
|
|
[ 'skia_os == "ios"',
|
2011-09-15 14:24:33 +00:00
|
|
|
{
|
|
|
|
'defines': [
|
2016-06-01 14:08:56 +00:00
|
|
|
# When targetting iOS and using gyp to generate the build files, it is
|
|
|
|
# not possible to select files to build depending on the architecture
|
|
|
|
# (i.e. it is not possible to use hand optimized assembly version). In
|
|
|
|
# that configuration, disable all optimisation.
|
2011-09-15 14:24:33 +00:00
|
|
|
'SK_BUILD_FOR_IOS',
|
2016-06-01 14:08:56 +00:00
|
|
|
'SK_BUILD_NO_OPTS',
|
2011-09-15 14:24:33 +00:00
|
|
|
],
|
2013-03-22 13:16:06 +00:00
|
|
|
'conditions' : [
|
|
|
|
[ 'skia_warnings_as_errors', {
|
|
|
|
'xcode_settings': {
|
|
|
|
'OTHER_CPLUSPLUSFLAGS': [
|
|
|
|
'-Werror',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
],
|
2011-09-15 14:24:33 +00:00
|
|
|
'configurations': {
|
|
|
|
'Debug': {
|
|
|
|
'xcode_settings': {
|
|
|
|
'GCC_OPTIMIZATION_LEVEL': '0',
|
|
|
|
},
|
|
|
|
},
|
2012-09-24 19:33:57 +00:00
|
|
|
'Release': {
|
|
|
|
'xcode_settings': {
|
2013-06-20 20:28:54 +00:00
|
|
|
'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
|
2012-09-24 19:33:57 +00:00
|
|
|
},
|
|
|
|
'defines': [ 'NDEBUG' ],
|
|
|
|
},
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
'xcode_settings': {
|
2014-04-05 01:13:43 +00:00
|
|
|
'ARCHS': ['armv7'],
|
2012-09-20 15:45:41 +00:00
|
|
|
'CODE_SIGNING_REQUIRED': 'NO',
|
2012-09-24 19:33:57 +00:00
|
|
|
'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
|
2012-09-20 15:45:41 +00:00
|
|
|
'SDKROOT': 'iphoneos',
|
2012-09-24 19:33:57 +00:00
|
|
|
'TARGETED_DEVICE_FAMILY': '1,2',
|
2015-11-17 00:20:34 +00:00
|
|
|
|
|
|
|
'CLANG_CXX_LIBRARY': 'libc++',
|
|
|
|
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
|
|
|
|
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
|
|
|
|
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
|
|
|
|
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
|
2016-03-28 19:43:39 +00:00
|
|
|
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
|
|
|
|
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden
|
2015-11-17 00:20:34 +00:00
|
|
|
|
|
|
|
'GCC_THUMB_SUPPORT': 'NO', # TODO(mtklein): why would we not want thumb?
|
2011-09-15 14:24:33 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2012-08-13 14:26:36 +00:00
|
|
|
|
2013-03-22 13:16:06 +00:00
|
|
|
[ 'skia_os == "android"',
|
2011-11-03 13:08:29 +00:00
|
|
|
{
|
|
|
|
'defines': [
|
|
|
|
'SK_BUILD_FOR_ANDROID',
|
2014-04-11 13:09:21 +00:00
|
|
|
|
2016-08-01 16:22:12 +00:00
|
|
|
# Android defines a fixed text gamma exponent instead of using SRGB
|
2014-04-11 13:09:21 +00:00
|
|
|
'SK_GAMMA_EXPONENT=1.4',
|
|
|
|
'SK_GAMMA_CONTRAST=0.0',
|
|
|
|
],
|
2014-02-04 16:08:48 +00:00
|
|
|
'configurations': {
|
|
|
|
'Release': {
|
|
|
|
'cflags': ['-O2'],
|
2016-04-25 18:45:35 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'skia_clang_build', {
|
|
|
|
'cflags!': ['-g'],
|
|
|
|
'cflags': [ '-gline-tables-only' ],
|
|
|
|
}],
|
|
|
|
],
|
2014-02-04 16:08:48 +00:00
|
|
|
},
|
|
|
|
},
|
2011-11-03 13:08:29 +00:00
|
|
|
'libraries': [
|
2011-11-08 19:03:43 +00:00
|
|
|
'-llog',
|
2011-11-03 13:08:29 +00:00
|
|
|
],
|
2011-12-05 13:55:55 +00:00
|
|
|
'cflags': [
|
2012-07-25 15:17:03 +00:00
|
|
|
'-fuse-ld=gold',
|
2011-12-05 13:55:55 +00:00
|
|
|
],
|
2011-11-03 13:08:29 +00:00
|
|
|
'conditions': [
|
2015-02-12 18:48:25 +00:00
|
|
|
[ '"x86" in skia_arch_type', {
|
2014-07-24 20:53:56 +00:00
|
|
|
'cflags': [
|
|
|
|
'-mssse3',
|
|
|
|
],
|
|
|
|
}],
|
2014-02-05 16:35:12 +00:00
|
|
|
[ 'skia_android_framework', {
|
2014-03-25 15:14:18 +00:00
|
|
|
'cflags!': [
|
|
|
|
'-fuse-ld=gold',
|
2015-02-12 21:27:40 +00:00
|
|
|
'-mssse3',
|
2014-03-25 15:14:18 +00:00
|
|
|
],
|
2014-02-05 16:35:12 +00:00
|
|
|
}],
|
2013-06-03 12:10:19 +00:00
|
|
|
[ 'skia_shared_lib', {
|
|
|
|
'defines': [
|
|
|
|
'SKIA_DLL',
|
|
|
|
'SKIA_IMPLEMENTATION=1',
|
2015-11-07 13:29:00 +00:00
|
|
|
# Needed until we fix https://bug.skia.org/2440 .
|
2014-07-09 14:26:40 +00:00
|
|
|
'SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG',
|
2013-06-03 12:10:19 +00:00
|
|
|
],
|
|
|
|
}],
|
2013-07-11 12:48:14 +00:00
|
|
|
[ 'skia_profile_enabled == 1', {
|
|
|
|
'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
|
2011-11-03 17:31:41 +00:00
|
|
|
}],
|
2016-03-07 20:30:47 +00:00
|
|
|
[ 'skia_clang_build', {
|
|
|
|
'cflags': [
|
|
|
|
'-Wno-unknown-warning-option', # Allows unknown warnings
|
|
|
|
# These flags that are on by default for only the android
|
|
|
|
# toolchain and no other platforms.
|
|
|
|
'-Wno-tautological-compare',
|
|
|
|
'-Wno-unused-command-line-argument',
|
|
|
|
],
|
|
|
|
}],
|
2012-08-13 14:26:36 +00:00
|
|
|
],
|
2011-11-03 13:08:29 +00:00
|
|
|
},
|
|
|
|
],
|
2011-09-15 14:24:33 +00:00
|
|
|
|
2014-05-08 15:29:57 +00:00
|
|
|
[ 'skia_moz2d', {
|
|
|
|
'defines': [
|
2014-06-18 21:05:22 +00:00
|
|
|
# add flags here (e.g. SK_SUPPORT_LEGACY_...) needed by moz2d
|
2014-05-08 15:29:57 +00:00
|
|
|
],
|
|
|
|
}],
|
|
|
|
|
2015-10-27 17:04:34 +00:00
|
|
|
[ 'skia_command_buffer and skia_os == "linux"', {
|
2015-10-02 01:29:34 +00:00
|
|
|
'ldflags': [
|
|
|
|
'-Wl,-rpath,\$$ORIGIN/lib',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
|
2015-10-27 17:04:34 +00:00
|
|
|
[ 'skia_command_buffer and skia_os == "mac"', {
|
|
|
|
'xcode_settings': {
|
|
|
|
'LD_RUNPATH_SEARCH_PATHS': ['@executable_path/.'],
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
|
2011-09-15 14:24:33 +00:00
|
|
|
], # end 'conditions'
|
2012-09-26 15:48:43 +00:00
|
|
|
# The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
|
|
|
|
'xcode_settings': {
|
|
|
|
'SYMROOT': '<(DEPTH)/xcodebuild',
|
|
|
|
},
|
2011-09-15 14:24:33 +00:00
|
|
|
}
|