aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar borenet@google.com <borenet@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-10 19:45:51 +0000
committerGravatar borenet@google.com <borenet@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-10 19:45:51 +0000
commitefb1d77ad2cb77f6b124b0674fccf67d9b737b60 (patch)
tree34209d9abb822ee4725b2fb83d783f57f7d40777
parent6293820c96ac1cf6f33377fb510549bf6a4f9ed6 (diff)
Build Skia as a static library
- Roll GYP so that we get non-thin archives on Linux - Add merge_static_libs.py - Add skia_core_lib target which builds core, ports, opts*, and utils - Replace dependencies on core/ports/opts/utils with skia_core_libs - Rename exportable libraries with "skia_" Review URL: https://codereview.appspot.com/6619049 git-svn-id: http://skia.googlecode.com/svn/trunk@5889 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--DEPS2
-rw-r--r--Makefile7
-rw-r--r--gyp/FileReaderApp.gyp5
-rw-r--r--gyp/SampleApp.gyp8
-rw-r--r--gyp/SimpleCocoaApp.gyp5
-rw-r--r--gyp/SimpleiOSApp.gyp5
-rw-r--r--gyp/animator.gyp2
-rw-r--r--gyp/bench.gyp13
-rw-r--r--gyp/common_conditions.gypi1
-rw-r--r--gyp/common_variables.gypi27
-rw-r--r--gyp/core.gyp20
-rw-r--r--gyp/debugger.gyp5
-rw-r--r--gyp/effects.gyp8
-rw-r--r--gyp/gm.gyp8
-rw-r--r--gyp/gpu.gyp4
-rw-r--r--gyp/images.gyp2
-rw-r--r--gyp/opts.gyp6
-rw-r--r--gyp/pdf.gyp6
-rw-r--r--gyp/ports.gyp2
-rw-r--r--gyp/sfnt.gyp2
-rw-r--r--gyp/shapeops_demo.gyp10
-rw-r--r--gyp/shapeops_edge.gyp8
-rw-r--r--gyp/skia_base_libs.gyp47
-rw-r--r--gyp/svg.gyp2
-rw-r--r--gyp/tests.gyp8
-rw-r--r--gyp/tools.gyp68
-rw-r--r--gyp/utils.gyp7
-rw-r--r--gyp/views.gyp7
-rw-r--r--gyp/xml.gyp2
-rw-r--r--gyp/xps.gyp5
-rw-r--r--skia.gyp3
-rwxr-xr-xtools/merge_static_libs.py66
32 files changed, 228 insertions, 143 deletions
diff --git a/DEPS b/DEPS
index 10dbd418dc..016213e386 100644
--- a/DEPS
+++ b/DEPS
@@ -9,7 +9,7 @@ use_relative_paths = True
#
deps = {
"third_party/externals/angle" : "http://angleproject.googlecode.com/svn/trunk@1268",
- "third_party/externals/gyp" : "http://gyp.googlecode.com/svn/trunk@1509",
+ "third_party/externals/gyp" : "http://gyp.googlecode.com/svn/trunk@1517",
"third_party/externals/libjpeg" : "http://src.chromium.org/svn/trunk/src/third_party/libjpeg@125399",
"third_party/externals/jsoncpp" : "http://src.chromium.org/svn/trunk/src/third_party/jsoncpp@125399",
"third_party/externals/jsoncpp/source/include" : "http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/include@248",
diff --git a/Makefile b/Makefile
index 4de8bc6f66..aa144100ba 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,12 @@
BUILDTYPE ?= Debug
CWD := $(shell pwd)
-ALL_TARGETS := core SampleApp bench gm tests tools
+ALL_TARGETS := skia_base_libs \
+ bench \
+ gm \
+ SampleApp \
+ tests \
+ tools
ifneq (,$(findstring skia_os=android, $(GYP_DEFINES)))
ifeq (,$(findstring android_make_apk=0, $(GYP_DEFINES)))
diff --git a/gyp/FileReaderApp.gyp b/gyp/FileReaderApp.gyp
index b56460bee0..bcd0f0dc38 100644
--- a/gyp/FileReaderApp.gyp
+++ b/gyp/FileReaderApp.gyp
@@ -18,11 +18,8 @@
'../src/utils/mac/SkOSWindow_Mac.cpp',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
- 'opts.gyp:opts',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
'views.gyp:views',
'xml.gyp:xml',
],
diff --git a/gyp/SampleApp.gyp b/gyp/SampleApp.gyp
index 39201527ae..c33c67ffe3 100644
--- a/gyp/SampleApp.gyp
+++ b/gyp/SampleApp.gyp
@@ -135,12 +135,10 @@
'../samplecode/SampleFontCache.cpp',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
- 'ports.gyp:ports',
'views.gyp:views',
- 'utils.gyp:utils',
'animator.gyp:animator',
'xml.gyp:xml',
'experimental.gyp:experimental',
@@ -290,10 +288,6 @@
'include_dirs': [
'../src/gpu', # To pull gl/GrGLUtil.h
],
- 'dependencies': [
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
- ],
}],
],
'msvs_settings': {
diff --git a/gyp/SimpleCocoaApp.gyp b/gyp/SimpleCocoaApp.gyp
index dd02c41ac8..3e17ad5b98 100644
--- a/gyp/SimpleCocoaApp.gyp
+++ b/gyp/SimpleCocoaApp.gyp
@@ -25,10 +25,7 @@
],
'dependencies': [
- 'core.gyp:core',
- 'opts.gyp:opts',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
+ 'skia_base_libs.gyp:skia_base_libs',
'views.gyp:views',
'xml.gyp:xml',
],
diff --git a/gyp/SimpleiOSApp.gyp b/gyp/SimpleiOSApp.gyp
index ea702be85f..3678e7cd1a 100644
--- a/gyp/SimpleiOSApp.gyp
+++ b/gyp/SimpleiOSApp.gyp
@@ -28,12 +28,9 @@
'../experimental/SimpleiOSApp/SimpleiOSApp-Info.plist',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
- 'opts.gyp:opts',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
'views.gyp:views',
'xml.gyp:xml',
],
diff --git a/gyp/animator.gyp b/gyp/animator.gyp
index b3c651cc3a..942e849336 100644
--- a/gyp/animator.gyp
+++ b/gyp/animator.gyp
@@ -6,7 +6,9 @@
'targets': [
{
'target_name': 'animator',
+ 'product_name': 'skia_animator',
'type': 'static_library',
+ 'standalone_static_library': 1,
'include_dirs': [
'../include/config',
'../include/core',
diff --git a/gyp/bench.gyp b/gyp/bench.gyp
index 7a413e1d24..1524b72edb 100644
--- a/gyp/bench.gyp
+++ b/gyp/bench.gyp
@@ -15,11 +15,9 @@
'bench.gypi'
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
'bench_timer',
],
'conditions': [
@@ -28,10 +26,6 @@
'include_dirs' : [
'../src/gpu',
],
- 'dependencies': [
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
- ],
},
],
],
@@ -54,7 +48,7 @@
'../src/gpu',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
],
'conditions': [
[ 'skia_os not in ["mac", "ios"]', {
@@ -83,9 +77,6 @@
],
}],
['skia_gpu == 1', {
- 'dependencies': [
- 'gpu.gyp:gr',
- ],
'sources': [
'../bench/BenchGpuTimer_gl.h',
'../bench/BenchGpuTimer_gl.cpp',
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index f8f283b802..e8e2fca1a2 100644
--- a/gyp/common_conditions.gypi
+++ b/gyp/common_conditions.gypi
@@ -324,7 +324,6 @@
'SK_USE_POSIX_THREADS'
],
}],
-
], # end 'conditions'
# The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
'xcode_settings': {
diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi
index d2a3d1048e..1976dbee27 100644
--- a/gyp/common_variables.gypi
+++ b/gyp/common_variables.gypi
@@ -52,21 +52,30 @@
'skia_os%': '<(skia_os)',
'conditions': [
- ['skia_os == "win"', {
+ [ 'skia_os == "win"', {
'os_posix%': 0,
}, {
'os_posix%': 1,
}],
- ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
+ [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
'skia_arch_width%': 64,
}, {
'skia_arch_width%': 32,
}],
- ['skia_os == "android"', {
+ [ 'skia_os == "android"', {
'skia_static_initializers%': 0,
}, {
'skia_static_initializers%': 1,
}],
+ [ 'skia_os == "ios"', {
+ 'skia_arch_type%': 'arm',
+ 'armv7%': 1,
+ 'arm_neon%': 0, # neon asm files known not to work with the ios build
+ },{ # skia_os is not ios
+ 'skia_arch_type%': 'x86',
+ 'armv7%': 0,
+ 'arm_neon%': 0,
+ }],
],
'skia_scalar%': 'float',
@@ -82,6 +91,8 @@
# Re-define all variables defined within the level-2 'variables' dict,
# so that siblings of the level-1 'variables' dict can see them.
+ 'armv7%': '<(armv7)',
+ 'arm_neon%': '<(arm_neon)',
'skia_os%': '<(skia_os)',
'os_posix%': '<(os_posix)',
'skia_scalar%': '<(skia_scalar)',
@@ -89,6 +100,7 @@
'skia_nv_path_rendering%': '<(skia_nv_path_rendering)',
'skia_angle%': '<(skia_angle)',
'skia_arch_width%': '<(skia_arch_width)',
+ 'skia_arch_type%': '<(skia_arch_type)',
'skia_directwrite%': '<(skia_directwrite)',
'android_make_apk%': '<(android_make_apk)',
'skia_nacl%': '<(skia_nacl)',
@@ -97,15 +109,6 @@
'skia_static_initializers%': '<(skia_static_initializers)',
'ios_sdk_version%': '6.0',
- 'conditions': [
- ['skia_os == "ios"', {
- 'skia_arch_type%': 'arm',
- 'armv7%': 1,
- 'arm_neon%': 0, # neon asm files known not to work with the ios build
- },{ # skia_os is not ios
- 'skia_arch_type%': 'x86',
- }],
- ],
# These are referenced by our .gypi files that list files (e.g. core.gypi)
#
'skia_src_path%': '../src',
diff --git a/gyp/core.gyp b/gyp/core.gyp
index 134ca8adc7..228fd06e56 100644
--- a/gyp/core.gyp
+++ b/gyp/core.gyp
@@ -3,7 +3,9 @@
'targets': [
{
'target_name': 'core',
+ 'product_name': 'skia_core',
'type': 'static_library',
+ 'standalone_static_library': 1,
'msvs_guid': 'B7760B5E-BFA8-486B-ACFD-49E3A6DE8E76',
'includes': [
@@ -100,6 +102,24 @@
'../include/pipe',
'ext',
],
+ 'conditions': [
+ [ 'skia_os == "mac"', {
+ 'include_dirs': [
+ '../include/utils/mac',
+ '../third_party/freetype/include/**',
+ ],
+ }],
+ [ 'skia_os == "ios"', {
+ 'include_dirs': [
+ '../include/utils/ios',
+ ],
+ }],
+ [ 'skia_os == "win"', {
+ 'include_dirs': [
+ 'config/win',
+ ],
+ }],
+ ],
},
'dependencies': [
'opts.gyp:opts'
diff --git a/gyp/debugger.gyp b/gyp/debugger.gyp
index 5552ca1209..cbaf492190 100644
--- a/gyp/debugger.gyp
+++ b/gyp/debugger.gyp
@@ -118,12 +118,9 @@
'<(moc_src_dir)/moc_SkGLWidget.cpp',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'images.gyp:images',
- 'ports.gyp:ports',
'effects.gyp:effects',
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
'debugger_mocs',
],
'link_settings': {
diff --git a/gyp/effects.gyp b/gyp/effects.gyp
index ef42cb90cb..e110c9f069 100644
--- a/gyp/effects.gyp
+++ b/gyp/effects.gyp
@@ -2,7 +2,9 @@
'targets': [
{
'target_name': 'effects',
+ 'product_name': 'skia_effects',
'type': 'static_library',
+ 'standalone_static_library': 1,
'includes': [
'effects.gypi',
],
@@ -16,7 +18,7 @@
],
},
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
],
'sources': [
'effects.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
@@ -26,10 +28,6 @@
'include_dirs': [
'../src/gpu',
],
- 'dependencies': [
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
- ],
}],
],
},
diff --git a/gyp/gm.gyp b/gyp/gm.gyp
index f519824357..6f0fc3d377 100644
--- a/gyp/gm.gyp
+++ b/gyp/gm.gyp
@@ -22,12 +22,10 @@
'../src/pipe/utils/SamplePipeControllers.cpp',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
'pdf.gyp:pdf',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
],
'conditions': [
['skia_os == "mac"', {
@@ -53,10 +51,6 @@
'include_dirs': [
'../src/gpu',
],
- 'dependencies': [
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
- ],
}],
],
},
diff --git a/gyp/gpu.gyp b/gyp/gpu.gyp
index 98ab257dcc..0dc84eeaf8 100644
--- a/gyp/gpu.gyp
+++ b/gyp/gpu.gyp
@@ -109,7 +109,9 @@
'targets': [
{
'target_name': 'skgr',
+ 'product_name': 'skia_skgr',
'type': 'static_library',
+ 'standalone_static_library': 1,
'includes': [
'gpu.gypi',
],
@@ -157,7 +159,9 @@
},
{
'target_name': 'gr',
+ 'product_name': 'skia_gr',
'type': 'static_library',
+ 'standalone_static_library': 1,
'includes': [
'gpu.gypi',
],
diff --git a/gyp/images.gyp b/gyp/images.gyp
index 7824cf93c6..2989afeb11 100644
--- a/gyp/images.gyp
+++ b/gyp/images.gyp
@@ -2,7 +2,9 @@
'targets': [
{
'target_name': 'images',
+ 'product_name': 'skia_images',
'type': 'static_library',
+ 'standalone_static_library': 1,
'dependencies': [
'libjpeg.gyp:*',
'utils.gyp:utils',
diff --git a/gyp/opts.gyp b/gyp/opts.gyp
index e5ceb36aa7..b8d7e22960 100644
--- a/gyp/opts.gyp
+++ b/gyp/opts.gyp
@@ -20,7 +20,9 @@
# separately as well.
{
'target_name': 'opts',
+ 'product_name': 'skia_opts',
'type': 'static_library',
+ 'standalone_static_library': 1,
'include_dirs': [
'../include/config',
'../include/core',
@@ -97,7 +99,9 @@
# gcc to generate SSSE3 code.
{
'target_name': 'opts_ssse3',
+ 'product_name': 'skia_opts_ssse3',
'type': 'static_library',
+ 'standalone_static_library': 1,
'include_dirs': [
'../include/config',
'../include/core',
@@ -130,7 +134,9 @@
# is very similar to the SSSE3 one.
{
'target_name': 'opts_neon',
+ 'product_name': 'skia_opts_neon',
'type': 'static_library',
+ 'standalone_static_library': 1,
'include_dirs': [
'../include/config',
'../include/core',
diff --git a/gyp/pdf.gyp b/gyp/pdf.gyp
index e7b0369a47..7b3b9ea0d2 100644
--- a/gyp/pdf.gyp
+++ b/gyp/pdf.gyp
@@ -2,11 +2,11 @@
'targets': [
{
'target_name': 'pdf',
+ 'product_name': 'skia_pdf',
'type': 'static_library',
+ 'standalone_static_library': 1,
'dependencies': [
- 'core.gyp:core',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
+ 'skia_base_libs.gyp:skia_base_libs',
'zlib.gyp:zlib',
],
'include_dirs': [
diff --git a/gyp/ports.gyp b/gyp/ports.gyp
index 1aa112fa7c..f743ad4f7f 100644
--- a/gyp/ports.gyp
+++ b/gyp/ports.gyp
@@ -3,7 +3,9 @@
'targets': [
{
'target_name': 'ports',
+ 'product_name': 'skia_ports',
'type': 'static_library',
+ 'standalone_static_library': 1,
'dependencies': [
'core.gyp:core',
'sfnt.gyp:sfnt',
diff --git a/gyp/sfnt.gyp b/gyp/sfnt.gyp
index 17dd2d8412..d4d9627ae8 100644
--- a/gyp/sfnt.gyp
+++ b/gyp/sfnt.gyp
@@ -2,7 +2,9 @@
'targets': [
{
'target_name': 'sfnt',
+ 'product_name': 'skia_sfnt',
'type': 'static_library',
+ 'standalone_static_library': 1,
'dependencies': [
'core.gyp:core',
],
diff --git a/gyp/shapeops_demo.gyp b/gyp/shapeops_demo.gyp
index 25ac70aba0..b6718cb93e 100644
--- a/gyp/shapeops_demo.gyp
+++ b/gyp/shapeops_demo.gyp
@@ -65,12 +65,10 @@
'../experimental/Intersection/TSearch.h',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
- 'ports.gyp:ports',
'views.gyp:views',
- 'utils.gyp:utils',
'animator.gyp:animator',
'xml.gyp:xml',
'svg.gyp:svg',
@@ -108,12 +106,6 @@
'../experimental/Intersection/EdgeDemoApp.xib',
],
}],
- [ 'skia_gpu == 1', {
- 'dependencies': [
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
- ],
- }],
],
'msvs_settings': {
'VCLinkerTool': {
diff --git a/gyp/shapeops_edge.gyp b/gyp/shapeops_edge.gyp
index cc62f3e2cb..11fe4b21c7 100644
--- a/gyp/shapeops_edge.gyp
+++ b/gyp/shapeops_edge.gyp
@@ -107,23 +107,17 @@
'../experimental/Intersection/thingsToDo.txt',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'experimental.gyp:experimental',
'images.gyp:images',
- 'ports.gyp:ports',
'pdf.gyp:pdf',
- 'utils.gyp:utils',
],
'conditions': [
[ 'skia_gpu == 1', {
'include_dirs': [
'../src/gpu',
],
- 'dependencies': [
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
- ],
}],
],
},
diff --git a/gyp/skia_base_libs.gyp b/gyp/skia_base_libs.gyp
new file mode 100644
index 0000000000..a611d30d0d
--- /dev/null
+++ b/gyp/skia_base_libs.gyp
@@ -0,0 +1,47 @@
+# The minimal set of static libraries for basic Skia functionality.
+{
+ 'variables': {
+ 'component_libs': [
+ 'core.gyp:core',
+ 'opts.gyp:opts',
+ 'ports.gyp:ports',
+ 'utils.gyp:utils',
+ ],
+ 'conditions': [
+ [ 'skia_arch_type == "x86"', {
+ 'component_libs': [
+ 'opts.gyp:opts_ssse3',
+ ],
+ }],
+ [ 'arm_neon == 1', {
+ 'component_libs': [
+ 'opts.gyp:opts_neon',
+ ],
+ }],
+ [ 'skia_gpu', {
+ 'component_libs': [
+ 'gpu.gyp:gr',
+ 'gpu.gyp:skgr',
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'skia_base_libs',
+ 'type': 'none',
+ 'dependencies': [
+ '<@(component_libs)',
+ ],
+ 'export_dependent_settings': [
+ '<@(component_libs)',
+ ],
+ },
+ ],
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/gyp/svg.gyp b/gyp/svg.gyp
index 9e90f28bac..3952fd7759 100644
--- a/gyp/svg.gyp
+++ b/gyp/svg.gyp
@@ -2,7 +2,9 @@
'targets': [
{
'target_name': 'svg',
+ 'product_name': 'skia_svg',
'type': 'static_library',
+ 'standalone_static_library': 1,
'include_dirs': [
'../include/config',
'../include/core',
diff --git a/gyp/tests.gyp b/gyp/tests.gyp
index 874bb7f642..c91388c456 100644
--- a/gyp/tests.gyp
+++ b/gyp/tests.gyp
@@ -103,24 +103,18 @@
'../src/pipe/utils/SamplePipeControllers.cpp',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'experimental.gyp:experimental',
'images.gyp:images',
- 'ports.gyp:ports',
'pdf.gyp:pdf',
'tools.gyp:picture_utils',
- 'utils.gyp:utils',
],
'conditions': [
[ 'skia_gpu == 1', {
'include_dirs': [
'../src/gpu',
],
- 'dependencies': [
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
- ],
}],
],
},
diff --git a/gyp/tools.gyp b/gyp/tools.gyp
index 69c6cae11a..f6e9a93b78 100644
--- a/gyp/tools.gyp
+++ b/gyp/tools.gyp
@@ -31,11 +31,9 @@
'../tools/skdiff_main.cpp',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
],
},
{
@@ -45,11 +43,9 @@
'../tools/skhello.cpp',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
],
},
{
@@ -59,11 +55,9 @@
'../tools/skimage_main.cpp',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
],
},
{
@@ -76,8 +70,7 @@
'../src/pipe/utils/',
],
'dependencies': [
- 'core.gyp:core',
- 'ports.gyp:ports',
+ 'skia_base_libs.gyp:skia_base_libs',
'tools.gyp:picture_renderer',
'tools.gyp:picture_utils',
],
@@ -97,47 +90,34 @@
'../bench',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
- 'ports.gyp:ports',
'tools.gyp:picture_utils',
'tools.gyp:picture_renderer',
'bench.gyp:bench_timer',
],
},
{
- 'target_name': 'picture_renderer',
- 'type': 'static_library',
- 'sources': [
+ 'target_name': 'picture_renderer',
+ 'type': 'static_library',
+ 'sources': [
'../tools/PictureRenderer.cpp',
'../src/pipe/utils/SamplePipeControllers.h',
'../src/pipe/utils/SamplePipeControllers.cpp',
- ],
- 'include_dirs': [
- '../src/pipe/utils/',
- '../src/utils/',
- ],
- 'dependencies': [
- 'core.gyp:core',
+ ],
+ 'include_dirs': [
+ '../src/pipe/utils/',
+ '../src/utils/',
+ ],
+ 'dependencies': [
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
'tools.gyp:picture_utils',
- 'utils.gyp:utils',
- ],
- 'export_dependent_settings': [
- 'images.gyp:images',
- ],
- 'conditions': [
- ['skia_gpu == 1', {
- 'dependencies': [
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
- ],
- 'export_dependent_settings': [
- 'gpu.gyp:gr',
- ],
- }],
- ],
+ ],
+ 'export_dependent_settings': [
+ 'images.gyp:images',
+ ],
},
{
'target_name': 'picture_utils',
@@ -147,7 +127,7 @@
'../tools/picture_utils.h',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
],
},
{
@@ -157,11 +137,9 @@
'../tools/pinspect.cpp',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
],
},
{
@@ -174,11 +152,9 @@
'../tools/filtermain.cpp',
],
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'effects.gyp:effects',
'images.gyp:images',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
],
},
],
diff --git a/gyp/utils.gyp b/gyp/utils.gyp
index e5274edc5a..cc25349045 100644
--- a/gyp/utils.gyp
+++ b/gyp/utils.gyp
@@ -2,11 +2,12 @@
'targets': [
{
'target_name': 'utils',
- 'dependencies': [
- 'core.gyp:core',
- ],
+ 'product_name': 'skia_utils',
'type': 'static_library',
+ 'standalone_static_library': 1,
'include_dirs': [
+ '../include/config',
+ '../include/core',
'../include/effects',
'../include/pipe',
'../include/utils',
diff --git a/gyp/views.gyp b/gyp/views.gyp
index db748c7e4d..ccb61e1af9 100644
--- a/gyp/views.gyp
+++ b/gyp/views.gyp
@@ -8,7 +8,9 @@
'targets': [
{
'target_name': 'views',
+ 'product_name': 'skia_views',
'type': 'static_library',
+ 'standalone_static_library': 1,
'include_dirs': [
'../include/config',
'../include/core',
@@ -110,11 +112,6 @@
'../src/views/win/skia_win.cpp',
],
}],
- [ 'skia_gpu == 1', {
- 'include_dirs': [
- '../include/gpu',
- ],
- }],
],
'direct_dependent_settings': {
'include_dirs': [
diff --git a/gyp/xml.gyp b/gyp/xml.gyp
index b7878e2c05..b7fdb8397a 100644
--- a/gyp/xml.gyp
+++ b/gyp/xml.gyp
@@ -2,7 +2,9 @@
'targets': [
{
'target_name': 'xml',
+ 'product_name': 'skia_xml',
'type': 'static_library',
+ 'standalone_static_library': 1,
'include_dirs': [
'../include/config',
'../include/core',
diff --git a/gyp/xps.gyp b/gyp/xps.gyp
index 1337fd340e..e5b7c0d6bb 100644
--- a/gyp/xps.gyp
+++ b/gyp/xps.gyp
@@ -2,11 +2,12 @@
'targets': [
{
'target_name': 'xps',
+ 'product_name': 'skia_xps',
'type': 'static_library',
+ 'standalone_static_library': 1,
'dependencies': [
- 'core.gyp:core',
+ 'skia_base_libs.gyp:skia_base_libs',
'images.gyp:images',
- 'utils.gyp:utils',
],
'include_dirs': [
'../include/device/xps',
diff --git a/skia.gyp b/skia.gyp
index 559ce7538b..d78435eaf7 100644
--- a/skia.gyp
+++ b/skia.gyp
@@ -15,6 +15,9 @@
'target_name': 'all',
'type': 'none',
'dependencies': [
+ # The minimal set of static libraries for basic Skia functionality.
+ 'gyp/skia_base_libs.gyp:skia_base_libs',
+
'gyp/bench.gyp:bench',
'gyp/gm.gyp:gm',
'gyp/SampleApp.gyp:SampleApp',
diff --git a/tools/merge_static_libs.py b/tools/merge_static_libs.py
new file mode 100755
index 0000000000..842be18c84
--- /dev/null
+++ b/tools/merge_static_libs.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import shutil
+import subprocess
+import sys
+import tempfile
+
+def _Usage():
+ print 'Usage: merge_static_libs OUTPUT_LIB INPUT_LIB [INPUT_LIB]*'
+ sys.exit(1)
+
+def MergeLibs(in_libs, out_lib):
+ """ Merges multiple static libraries into one.
+
+ in_libs: list of paths to static libraries to be merged
+ out_lib: path to the static library which will be created from in_libs
+ """
+ if os.name == 'posix':
+ tempdir = tempfile.mkdtemp()
+ abs_in_libs = []
+ for in_lib in in_libs:
+ abs_in_libs.append(os.path.abspath(in_lib))
+ curdir = os.getcwd()
+ os.chdir(tempdir)
+ objects = []
+ ar = os.environ.get('AR', 'ar')
+ for in_lib in abs_in_libs:
+ proc = subprocess.Popen([ar, '-t', in_lib], stdout=subprocess.PIPE)
+ proc.wait()
+ obj_str = proc.communicate()[0]
+ current_objects = obj_str.rstrip().split('\n')
+ proc = subprocess.Popen([ar, '-x', in_lib], stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ proc.wait()
+ if proc.poll() == 0:
+ # The static library is non-thin, and we extracted objects
+ for object in current_objects:
+ objects.append(os.path.abspath(object))
+ elif 'thin archive' in proc.communicate()[0]:
+ # The static library is thin, so it contains the paths to its objects
+ for object in current_objects:
+ objects.append(object)
+ else:
+ raise Exception('Failed to extract objects from %s.' % in_lib)
+ os.chdir(curdir)
+ if not subprocess.call([ar, '-crs', out_lib] + objects) == 0:
+ raise Exception('Failed to add object files to %s' % out_lib)
+ shutil.rmtree(tempdir)
+ elif os.name == 'nt':
+ subprocess.call(['lib', '/OUT:%s' % out_lib] + in_libs)
+ else:
+ raise Exception('Error: Your platform is not supported')
+
+def Main():
+ if len(sys.argv) < 3:
+ _Usage()
+ out_lib = sys.argv[1]
+ in_libs = sys.argv[2:]
+ MergeLibs(in_libs, out_lib)
+
+if '__main__' == __name__:
+ sys.exit(Main())