diff options
author | 2015-03-30 12:53:48 -0700 | |
---|---|---|
committer | 2015-03-30 12:53:48 -0700 | |
commit | 5c9fa2844c4f97b9358d547f947372f680c68dd1 (patch) | |
tree | ad926b44922b3c352ee241b1ec035445e695d711 /gyp/ports.gyp | |
parent | 9b3edef75d8f437c4df887c1e0cb872b0de63539 (diff) |
Add option to embed font data into executable.
Some tools would like to be built with all resources embedded.
This change makes it possible to build a font manager which
uses font data embedded into the executable.
Review URL: https://codereview.chromium.org/1015723004
Diffstat (limited to 'gyp/ports.gyp')
-rw-r--r-- | gyp/ports.gyp | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/gyp/ports.gyp b/gyp/ports.gyp index 3cdc7343f5..0f442cde1b 100644 --- a/gyp/ports.gyp +++ b/gyp/ports.gyp @@ -70,7 +70,43 @@ }], [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]', { 'conditions': [ - [ 'skia_no_fontconfig', { + [ 'skia_embedded_fonts', { + 'link_settings': { + 'libraries': [ + '-ldl', + ], + }, + 'variables': { + 'embedded_font_data_identifier': 'sk_fonts', + 'fonts_to_include': [ + '../resources/Funkster.ttf', + ], + }, + 'sources': [ + '../src/ports/SkFontHost_linux.cpp', + ], + 'actions': [{ + 'action_name': 'generate_embedded_font_data', + 'inputs': [ + '../tools/embed_resources.py', + '<@(fonts_to_include)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/ports/fonts/fonts.cpp', + ], + 'action': ['python', '../tools/embed_resources.py', + '--align', '4', + '--name', '<(embedded_font_data_identifier)', + '--input', '<@(fonts_to_include)', + '--output', '<@(_outputs)', + ], + 'message': 'Generating <@(_outputs)', + 'process_outputs_as_sources': 1, + }], + 'defines': [ + 'SK_EMBEDDED_FONTS=<(embedded_font_data_identifier)', + ], + }, 'skia_no_fontconfig', { 'link_settings': { 'libraries': [ '-ldl', |