From 8846cb22cea7842d8dafe25a557215e31e9deeec Mon Sep 17 00:00:00 2001 From: "epoger@google.com" Date: Fri, 1 Jul 2011 20:20:07 +0000 Subject: Create new 'skia_os' variable to replace use of 'OS' in most places. http://codereview.appspot.com/4627085 git-svn-id: http://skia.googlecode.com/svn/trunk@1782 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gyp/CocoaDebuggerApp.gyp | 2 +- gyp/FileReaderApp.gyp | 2 +- gyp/SampleApp.gyp | 6 +++--- gyp/SimpleCocoaApp.gyp | 2 +- gyp/bench.gyp | 14 ++++---------- gyp/common.gypi | 28 ++++++++++++++++++++++------ gyp/core.gyp | 8 ++++---- gyp/gpu.gyp | 30 +++++++++++++++--------------- gyp/images.gyp | 10 +++++----- gyp/opts.gyp | 2 +- gyp/utils.gyp | 12 ++++++------ gyp/views.gyp | 4 ++-- gyp/xml.gyp | 2 +- gyp/zlib.gyp | 4 ++-- 14 files changed, 68 insertions(+), 58 deletions(-) diff --git a/gyp/CocoaDebuggerApp.gyp b/gyp/CocoaDebuggerApp.gyp index 1960a670e0..e53dfbb106 100644 --- a/gyp/CocoaDebuggerApp.gyp +++ b/gyp/CocoaDebuggerApp.gyp @@ -31,7 +31,7 @@ ], 'conditions' : [ # Only supports Mac currently - ['OS == "mac"', { + ['skia_os == "mac"', { 'sources': [ '../experimental/CocoaDebugger/CocoaDebugger-Info.plist', '../experimental/CocoaDebugger/CocoaDebugger_Prefix.pch', diff --git a/gyp/FileReaderApp.gyp b/gyp/FileReaderApp.gyp index 2db992ff99..0e2c48f802 100644 --- a/gyp/FileReaderApp.gyp +++ b/gyp/FileReaderApp.gyp @@ -30,7 +30,7 @@ ], 'conditions' : [ # Only supports Mac currently - ['OS == "mac"', { + ['skia_os == "mac"', { 'sources': [ '../experimental/SimpleCocoaApp/SkNSWindow.mm', '../experimental/SimpleCocoaApp/SkNSView.mm', diff --git a/gyp/SampleApp.gyp b/gyp/SampleApp.gyp index 4e01526452..0c4c04cb5e 100644 --- a/gyp/SampleApp.gyp +++ b/gyp/SampleApp.gyp @@ -135,19 +135,19 @@ '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', ], diff --git a/gyp/SimpleCocoaApp.gyp b/gyp/SimpleCocoaApp.gyp index 9f415e4d11..ead9fe4f98 100644 --- a/gyp/SimpleCocoaApp.gyp +++ b/gyp/SimpleCocoaApp.gyp @@ -28,7 +28,7 @@ ], 'conditions' : [ # Only supports Mac currently - [ 'OS == "mac"', { + [ 'skia_os == "mac"', { 'sources': [ '../include/utils/mac/SkCGUtils.h', '../src/utils/mac/SkCreateCGImageRef.cpp', diff --git a/gyp/bench.gyp b/gyp/bench.gyp index 11f0461556..c57b51e803 100644 --- a/gyp/bench.gyp +++ b/gyp/bench.gyp @@ -1,11 +1,5 @@ # 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', @@ -53,13 +47,13 @@ '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', @@ -71,13 +65,13 @@ ], }, }], - [ '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', diff --git a/gyp/common.gypi b/gyp/common.gypi index d1f23d5758..a9b0b537fe 100644 --- a/gyp/common.gypi +++ b/gyp/common.gypi @@ -12,13 +12,29 @@ # 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': '', ], }], - [ 'OS == "linux"', { + [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', { 'link_settings': { 'libraries': [ '-lz', ], }, 'defines': [ 'SK_ZLIB_INCLUDE=', ], }], -- cgit v1.2.3