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
This commit is contained in:
epoger@google.com 2011-07-01 20:20:07 +00:00
Родитель 5351b373b3
Коммит 8846cb22ce
14 изменённых файлов: 68 добавлений и 58 удалений

Просмотреть файл

@ -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',

Просмотреть файл

@ -30,7 +30,7 @@
],
'conditions' : [
# Only supports Mac currently
['OS == "mac"', {
['skia_os == "mac"', {
'sources': [
'../experimental/SimpleCocoaApp/SkNSWindow.mm',
'../experimental/SimpleCocoaApp/SkNSView.mm',

Просмотреть файл

@ -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',
],

Просмотреть файл

@ -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',

Просмотреть файл

@ -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',

Просмотреть файл

@ -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': '<!(Cannot build with skia_os=<(skia_os) on OS=<(OS))'}],
],
},
'skia_scalar%': '<(skia_scalar)',
'configurations': {
'Debug': {
@ -51,7 +67,7 @@
}
],
['OS == "win"',
['skia_os == "win"',
{
'defines': [
'SK_BUILD_FOR_WIN32',
@ -101,7 +117,7 @@
},
],
['OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"',
['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
{
'defines': [
'SK_SAMPLES_FOR_X',
@ -122,7 +138,7 @@
},
],
['OS == "mac"',
['skia_os == "mac"',
{
'defines': [
'SK_BUILD_FOR_MAC',

Просмотреть файл

@ -254,7 +254,7 @@
],
'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',
@ -275,7 +275,7 @@
],
},
}],
[ 'OS == "mac"', {
[ 'skia_os == "mac"', {
'include_dirs': [
'../include/utils/mac',
],
@ -296,7 +296,7 @@
],
},
}],
[ 'OS == "win"', {
[ 'skia_os == "win"', {
'include_dirs': [
'config/win',
],
@ -308,7 +308,7 @@
'../src/ports/SkDebug_stdio.cpp',
],
}],
[ 'OS != "win"', {
[ 'skia_os != "win"', {
'sources!': [
'../src/ports/SkDebug_win.cpp',
'../src/ports/SkTime_win.cpp',

Просмотреть файл

@ -28,17 +28,17 @@
'../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',
],
@ -46,17 +46,17 @@
],
'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',
],
@ -197,7 +197,7 @@
'GR_IMPLEMENTATION=1',
],
'conditions': [
[ 'OS == "linux"', {
[ 'skia_os == "linux"', {
'defines': [
'GR_LINUX_BUILD=1',
],
@ -211,7 +211,7 @@
],
},
}],
[ 'OS == "mac"', {
[ 'skia_os == "mac"', {
'defines': [
'GR_MAC_BUILD=1',
],
@ -224,7 +224,7 @@
'../gpu/src/GrGLDefaultInterface_none.cpp',
],
}],
[ 'OS == "win"', {
[ 'skia_os == "win"', {
'defines': [
'GR_WIN32_BUILD=1',
'GR_GL_FUNCTION_TYPE=__stdcall',
@ -233,17 +233,17 @@
'../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',
],
@ -251,17 +251,17 @@
],
'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',

Просмотреть файл

@ -55,7 +55,7 @@
'../src/ports/SkImageDecoder_WIC.cpp',
],
'conditions': [
[ 'OS == "win"', {
[ 'skia_os == "win"', {
'sources!': [
'../include/images/SkJpegUtility.h',
@ -69,12 +69,12 @@
'../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',
@ -87,12 +87,12 @@
'../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',

Просмотреть файл

@ -30,7 +30,7 @@
'../src/core',
],
'conditions': [
[ '(OS == "linux" or OS == "freebsd" or OS == "openbsd")', {
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
'cflags': [
'-msse2',
],

Просмотреть файл

@ -93,7 +93,7 @@
'../src/utils/SDL/SkOSWindow_SDL.cpp',
],
'conditions': [
[ 'OS == "mac"', {
[ 'skia_os == "mac"', {
'sources!': [
'../src/utils/SkEGLContext_none.cpp',
],
@ -107,7 +107,7 @@
'../include/utils/mac',
],
},
},{ #else if 'OS != "mac"'
},{ #else if 'skia_os != "mac"'
'include_dirs!': [
'../include/utils/mac',
],
@ -119,7 +119,7 @@
'../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',
],
@ -129,7 +129,7 @@
'-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',
],
@ -139,7 +139,7 @@
'../src/utils/unix/SkOSWindow_Unix.cpp',
],
}],
[ 'OS == "win"', {
[ 'skia_os == "win"', {
'sources!': [
'../src/utils/SkEGLContext_none.cpp',
],
@ -148,7 +148,7 @@
'../include/utils/win',
],
},
},{ #else if 'OS != "win"'
},{ #else if 'skia_os != "win"'
'include_dirs!': [
'../include/utils/win',
],

Просмотреть файл

@ -73,7 +73,7 @@
'../src/views/SkListWidget.cpp', #depends on missing SkListSource implementation
],
'conditions': [
[ 'OS == "mac"', {
[ 'skia_os == "mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
@ -81,7 +81,7 @@
],
},
}],
[ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
'sources': [
'../unix_test_app/main.cpp',
],

Просмотреть файл

@ -33,7 +33,7 @@
'../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',

Просмотреть файл

@ -16,7 +16,7 @@
'../src/core/SkFlate.cpp',
],
'conditions': [
[ 'OS == "mac"', {
[ 'skia_os == "mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/usr/lib/libz.dylib',
@ -24,7 +24,7 @@
},
'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>', ],
}],