diff options
Diffstat (limited to 'gn/gn_to_bp.py')
-rw-r--r-- | gn/gn_to_bp.py | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py index c8fc0a9293..3fc30a03b5 100644 --- a/gn/gn_to_bp.py +++ b/gn/gn_to_bp.py @@ -243,7 +243,6 @@ dm_srcs = {s for s in dm_srcs if not s.endswith('.h')} nanobench_srcs = {s for s in nanobench_srcs if not s.endswith('.h')} # Most defines go into SkUserConfig.h, where they're seen by Skia and its users. -# Start with the defines :skia uses, minus a couple. We'll add more in a bit. defines = [str(d) for d in js['targets']['//:skia']['defines']] defines.remove('NDEBUG') # Let the Android build control this. defines.remove('SKIA_IMPLEMENTATION=1') # Only libskia should have this define. @@ -253,7 +252,6 @@ defines.remove('SKIA_IMPLEMENTATION=1') # Only libskia should have this define. # This .gni file we want to read is close enough to Python syntax # that we can use execfile() if we supply definitions for GN builtins. -# While we're at it, grab defines specific to Android Framework the same way. def get_path_info(path, kind): assert kind == "abspath" @@ -264,20 +262,6 @@ builtins = { 'get_path_info': get_path_info } defs = {} here = os.path.dirname(__file__) execfile(os.path.join(here, 'opts.gni'), builtins, defs) -execfile(os.path.join(here, 'android_framework_defines.gni'), builtins, defs) - -# This should finish off the defines. -defines += defs['android_framework_defines'] -defines.extend([ - 'GR_GL_CUSTOM_SETUP_HEADER "gl/GrGLConfig_chrome.h"', - 'GR_TEST_UTILS 1', - 'SKIA_DLL', - 'SK_BUILD_FOR_ANDROID_FRAMEWORK', - 'SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)', - 'SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)', - 'SK_USE_FREETYPE_EMBOLDEN', -]) -# TODO: move these all to android_framework_defines.gni? # Turn paths from opts.gni into paths relative to external/skia. def scrub(lst): @@ -326,9 +310,11 @@ with open('Android.bp', 'w') as f: #... and all the #defines we want to put in SkUserConfig.h. with open('include/config/SkUserConfig.h', 'w') as f: - print >>f, '// This file is autogenerated by gn_to_bp.py.' + print >>f, '// DO NOT MODIFY! This file is autogenerated by gn_to_bp.py.' + print >>f, '// If need to change a define, modify SkUserConfigManual.h' print >>f, '#ifndef SkUserConfig_DEFINED' print >>f, '#define SkUserConfig_DEFINED' + print >>f, '#include "SkUserConfigManual.h"' for define in sorted(defines): print >>f, ' #define', define.replace('=', ' ') print >>f, '#endif//SkUserConfig_DEFINED' |