],
'conditions' : [
# Only supports Mac currently
- ['OS == "mac"', {
+ ['skia_os == "mac"', {
'sources': [
'../experimental/CocoaDebugger/CocoaDebugger-Info.plist',
'../experimental/CocoaDebugger/CocoaDebugger_Prefix.pch',
],
'conditions' : [
# Only supports Mac currently
- ['OS == "mac"', {
+ ['skia_os == "mac"', {
'sources': [
'../experimental/SimpleCocoaApp/SkNSWindow.mm',
'../experimental/SimpleCocoaApp/SkNSView.mm',
'pdf.gyp:pdf',
],
'conditions' : [
- [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
+ [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
'sources!': [
'../samplecode/SampleDecode.cpp',
],
}],
- [ 'OS == "win"', {
+ [ 'skia_os == "win"', {
'sources!': [
# require UNIX functions
'../samplecode/SampleEncode.cpp',
'../samplecode/SamplePageFlip.cpp',
],
}],
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'sources!': [
'../samplecode/SampleDecode.cpp',
],
],
'conditions' : [
# Only supports Mac currently
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'sources': [
'../include/utils/mac/SkCGUtils.h',
'../src/utils/mac/SkCreateCGImageRef.cpp',
# GYP file to build performance testbench.
#
-# To build and run on Linux:
-# ./gyp_skia bench.gyp && make
-# out/Debug/bench -repeat 2
-#
-# Building on other platforms not tested yet.
-#
{
'includes': [
'apptype_console.gypi',
'utils.gyp:utils',
],
'conditions': [
- [ 'OS != "mac"', {
+ [ 'skia_os != "mac"', {
'sources!': [
'../bench/BenchSysTimer_mach.h',
'../bench/BenchSysTimer_mach.cpp',
],
}],
- [ 'OS not in ["linux", "freebsd", "openbsd", "solaris"]', {
+ [ 'skia_os not in ["linux", "freebsd", "openbsd", "solaris"]', {
'sources!': [
'../bench/BenchSysTimer_posix.h',
'../bench/BenchSysTimer_posix.cpp',
],
},
}],
- [ 'OS != "win"', {
+ [ 'skia_os != "win"', {
'sources!': [
'../bench/BenchSysTimer_windows.h',
'../bench/BenchSysTimer_windows.cpp',
],
}],
- [ 'OS in ["win", "mac", "linux", "freebsd", "openbsd", "solaris"]', {
+ [ 'skia_os in ["win", "mac", "linux", "freebsd", "openbsd", "solaris"]', {
'sources!': [
'../bench/BenchGpuTimer_none.h',
'../bench/BenchGpuTimer_none.cpp',
# See the License for the specific language governing permissions and
# limitations under the License.
{
+ # 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)',
+
'target_defaults': {
- # Define variables, and allow for override in GYP_DEFINES environment var.
+ # Validate the 'skia_os' setting against 'OS', because only certain
+ # combinations work. You should only override 'skia_os' for certain
+ # situations, like building for iOS on a Mac.
'variables': {
- 'skia_scalar%': 'float',
+ 'conditions': [
+ ['skia_os != OS and not (skia_os == "ios" and OS == "mac")',
+ {'error': '<!(Cannot build with skia_os=<(skia_os) on OS=<(OS))'}],
+ ],
},
- 'skia_scalar%': '<(skia_scalar)',
'configurations': {
'Debug': {
}
],
- ['OS == "win"',
+ ['skia_os == "win"',
{
'defines': [
'SK_BUILD_FOR_WIN32',
},
],
- ['OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"',
+ ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
{
'defines': [
'SK_SAMPLES_FOR_X',
},
],
- ['OS == "mac"',
+ ['skia_os == "mac"',
{
'defines': [
'SK_BUILD_FOR_MAC',
],
'msvs_disabled_warnings': [4244, 4267,4345, 4390, 4554, 4800],
'conditions': [
- [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
+ [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
'cflags': [
'-Wno-unused',
'-Wno-unused-function',
],
},
}],
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'include_dirs': [
'../include/utils/mac',
],
],
},
}],
- [ 'OS == "win"', {
+ [ 'skia_os == "win"', {
'include_dirs': [
'config/win',
],
'../src/ports/SkDebug_stdio.cpp',
],
}],
- [ 'OS != "win"', {
+ [ 'skia_os != "win"', {
'sources!': [
'../src/ports/SkDebug_win.cpp',
'../src/ports/SkTime_win.cpp',
'../src/gpu/SkGrTexturePixelRef.cpp',
],
'conditions': [
- [ 'OS == "linux"', {
+ [ 'skia_os == "linux"', {
'defines': [
'GR_LINUX_BUILD=1',
],
}],
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'defines': [
'GR_MAC_BUILD=1',
],
}],
- [ 'OS == "win"', {
+ [ 'skia_os == "win"', {
'defines': [
'GR_WIN32_BUILD=1',
],
],
'direct_dependent_settings': {
'conditions': [
- [ 'OS == "linux"', {
+ [ 'skia_os == "linux"', {
'defines': [
'GR_LINUX_BUILD=1',
],
}],
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'defines': [
'GR_MAC_BUILD=1',
],
}],
- [ 'OS == "win"', {
+ [ 'skia_os == "win"', {
'defines': [
'GR_WIN32_BUILD=1',
],
'GR_IMPLEMENTATION=1',
],
'conditions': [
- [ 'OS == "linux"', {
+ [ 'skia_os == "linux"', {
'defines': [
'GR_LINUX_BUILD=1',
],
],
},
}],
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'defines': [
'GR_MAC_BUILD=1',
],
'../gpu/src/GrGLDefaultInterface_none.cpp',
],
}],
- [ 'OS == "win"', {
+ [ 'skia_os == "win"', {
'defines': [
'GR_WIN32_BUILD=1',
'GR_GL_FUNCTION_TYPE=__stdcall',
'../gpu/src/GrGLDefaultInterface_none.cpp',
],
}],
- [ 'OS != "win"', {
+ [ 'skia_os != "win"', {
'sources!': [
'../gpu/src/win/GrGLDefaultInterface_win.cpp',
],
}],
- [ 'OS != "mac"', {
+ [ 'skia_os != "mac"', {
'sources!': [
'../gpu/src/mac/GrGLDefaultInterface_mac.cpp',
],
}],
- [ 'OS != "linux"', {
+ [ 'skia_os != "linux"', {
'sources!': [
'../gpu/src/unix/GrGLDefaultInterface_unix.cpp',
],
],
'direct_dependent_settings': {
'conditions': [
- [ 'OS == "linux"', {
+ [ 'skia_os == "linux"', {
'defines': [
'GR_LINUX_BUILD=1',
],
}],
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'defines': [
'GR_MAC_BUILD=1',
],
}],
- [ 'OS == "win"', {
+ [ 'skia_os == "win"', {
'defines': [
'GR_WIN32_BUILD=1',
'GR_GL_FUNCTION_TYPE=__stdcall',
'../src/ports/SkImageDecoder_WIC.cpp',
],
'conditions': [
- [ 'OS == "win"', {
+ [ 'skia_os == "win"', {
'sources!': [
'../include/images/SkJpegUtility.h',
'../src/images/SkJpegUtility.cpp',
'../src/images/SkMovie_gif.cpp',
],
- },{ #else if OS != win
+ },{ #else if skia_os != win
'sources!': [
'../src/ports/SkImageDecoder_WIC.cpp',
],
}],
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'sources!': [
'../include/images/SkJpegUtility.h',
'../src/images/SkJpegUtility.cpp',
'../src/images/SkMovie_gif.cpp',
],
- },{ #else if OS != mac
+ },{ #else if skia_os != mac
'sources!': [
'../src/ports/SkImageDecoder_CG.cpp',
],
}],
- [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
+ [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
'sources!': [
'../include/images/SkJpegUtility.h',
'../src/core',
],
'conditions': [
- [ '(OS == "linux" or OS == "freebsd" or OS == "openbsd")', {
+ [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
'cflags': [
'-msse2',
],
'../src/utils/SDL/SkOSWindow_SDL.cpp',
],
'conditions': [
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'sources!': [
'../src/utils/SkEGLContext_none.cpp',
],
'../include/utils/mac',
],
},
- },{ #else if 'OS != "mac"'
+ },{ #else if 'skia_os != "mac"'
'include_dirs!': [
'../include/utils/mac',
],
'../src/utils/mac/SkOSWindow_Mac.cpp',
],
}],
- [ 'OS in ["linux", "freebsd", "openbsd", "solaris"]', {
+ [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
'sources!': [
'../src/utils/SkEGLContext_none.cpp',
],
'-lGLU',
],
},
- },{ #else if 'OS not in ["linux", "freebsd", "openbsd", "solaris"]'
+ },{ #else if 'skia_os not in ["linux", "freebsd", "openbsd", "solaris"]'
'include_dirs!': [
'../include/utils/unix',
],
'../src/utils/unix/SkOSWindow_Unix.cpp',
],
}],
- [ 'OS == "win"', {
+ [ 'skia_os == "win"', {
'sources!': [
'../src/utils/SkEGLContext_none.cpp',
],
'../include/utils/win',
],
},
- },{ #else if 'OS != "win"'
+ },{ #else if 'skia_os != "win"'
'include_dirs!': [
'../include/utils/win',
],
'../src/views/SkListWidget.cpp', #depends on missing SkListSource implementation
],
'conditions': [
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
],
},
}],
- [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
+ [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
'sources': [
'../unix_test_app/main.cpp',
],
'../src/xml/SkXMLPullParser.cpp', #if 0 around class decl in header
],
'conditions': [
- [ 'OS == "win" or OS == "mac" or OS == "linux" or OS == "openbsd" or OS == "solaris"', {
+ [ 'skia_os in ["win", "mac", "linux", "freebsd", "openbsd", "solaris"]', {
'sources!': [
# no jsapi.h by default on system
'../include/xml/SkJS.h',
'../src/core/SkFlate.cpp',
],
'conditions': [
- [ 'OS == "mac"', {
+ [ 'skia_os == "mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/usr/lib/libz.dylib',
},
'defines': [ 'SK_ZLIB_INCLUDE=<zlib.h>', ],
}],
- [ 'OS == "linux"', {
+ [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
'link_settings': { 'libraries': [ '-lz', ], },
'defines': [ 'SK_ZLIB_INCLUDE=<zlib.h>', ],
}],