Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # |
| 3 | # Copyright 2016 Google Inc. |
| 4 | # |
| 5 | # Use of this source code is governed by a BSD-style license that can be |
| 6 | # found in the LICENSE file. |
| 7 | |
| 8 | # Generate Android.bp for Skia from GN configuration. |
| 9 | |
| 10 | import json |
| 11 | import os |
| 12 | import pprint |
| 13 | import string |
| 14 | import subprocess |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 15 | import tempfile |
| 16 | |
| 17 | # First we start off with a template for Android.bp, |
| 18 | # with holes for source lists and include directories. |
| 19 | bp = string.Template('''// This file is autogenerated by gn_to_bp.py. |
| 20 | |
Derek Sollenberger | 5a93216 | 2017-09-21 14:25:14 -0400 | [diff] [blame] | 21 | cc_library_static { |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 22 | name: "libskia", |
| 23 | cflags: [ |
Leon Scroggins III | 981a31e | 2017-10-06 11:53:53 -0400 | [diff] [blame] | 24 | $cflags |
| 25 | ], |
| 26 | |
| 27 | cppflags:[ |
| 28 | $cflags_cc |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 29 | ], |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 30 | |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 31 | export_include_dirs: [ |
| 32 | $export_includes |
| 33 | ], |
Mike Klein | 27eb22b | 2016-12-07 12:27:56 -0500 | [diff] [blame] | 34 | |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 35 | local_include_dirs: [ |
| 36 | $local_includes |
| 37 | ], |
Mike Klein | 27eb22b | 2016-12-07 12:27:56 -0500 | [diff] [blame] | 38 | |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 39 | srcs: [ |
| 40 | $srcs |
| 41 | ], |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 42 | |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 43 | arch: { |
| 44 | arm: { |
| 45 | srcs: [ |
| 46 | $arm_srcs |
| 47 | ], |
Mike Klein | 27eb22b | 2016-12-07 12:27:56 -0500 | [diff] [blame] | 48 | |
Leon Scroggins III | f7332d3 | 2017-08-10 09:09:54 -0400 | [diff] [blame] | 49 | neon: { |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 50 | srcs: [ |
| 51 | $arm_neon_srcs |
| 52 | ], |
| 53 | }, |
| 54 | }, |
| 55 | |
| 56 | arm64: { |
| 57 | srcs: [ |
| 58 | $arm64_srcs |
| 59 | ], |
| 60 | }, |
| 61 | |
| 62 | mips: { |
| 63 | srcs: [ |
Mike Klein | 40a82bd | 2016-12-20 17:34:29 -0500 | [diff] [blame] | 64 | $none_srcs |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 65 | ], |
| 66 | }, |
| 67 | |
| 68 | mips64: { |
| 69 | srcs: [ |
Mike Klein | 40a82bd | 2016-12-20 17:34:29 -0500 | [diff] [blame] | 70 | $none_srcs |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 71 | ], |
| 72 | }, |
| 73 | |
| 74 | x86: { |
| 75 | srcs: [ |
| 76 | $x86_srcs |
| 77 | ], |
Leon Scroggins III | 74663e7 | 2017-11-30 14:42:58 -0500 | [diff] [blame] | 78 | cflags: [ |
Leon Scroggins III | 6d892f5 | 2017-12-01 09:48:10 -0500 | [diff] [blame] | 79 | // Clang seems to think new/malloc will only be 4-byte aligned |
| 80 | // on x86 Android. We're pretty sure it's actually 8-byte |
| 81 | // alignment. tests/OverAlignedTest.cpp has more information, |
| 82 | // and should fail if we're wrong. |
Leon Scroggins III | 74663e7 | 2017-11-30 14:42:58 -0500 | [diff] [blame] | 83 | "-Wno-over-aligned" |
| 84 | ], |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 85 | }, |
| 86 | |
| 87 | x86_64: { |
| 88 | srcs: [ |
| 89 | $x86_srcs |
| 90 | ], |
| 91 | }, |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 92 | }, |
Mike Klein | 27eb22b | 2016-12-07 12:27:56 -0500 | [diff] [blame] | 93 | |
Zhizhou Yang | e18b779 | 2017-12-11 10:37:44 -0800 | [diff] [blame] | 94 | defaults: ["skia_deps", |
| 95 | "skia_pgo", |
| 96 | ], |
| 97 | } |
| 98 | |
| 99 | // Build libskia with PGO by default. |
| 100 | // Location of PGO profile data is defined in build/soong/cc/pgo.go |
| 101 | // and is separate from skia. |
| 102 | // To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable |
| 103 | // or set enable_profile_use property to false. |
| 104 | cc_defaults { |
| 105 | name: "skia_pgo", |
| 106 | pgo: { |
| 107 | instrumentation: true, |
| 108 | profile_file: "skia/skia.profdata", |
| 109 | benchmarks: ["hwui", "skia"], |
| 110 | enable_profile_use: true, |
| 111 | }, |
Derek Sollenberger | 5a93216 | 2017-09-21 14:25:14 -0400 | [diff] [blame] | 112 | } |
| 113 | |
Pirama Arumuga Nainar | de2b95e | 2017-12-13 11:07:39 -0800 | [diff] [blame] | 114 | // "defaults" property to disable profile use for Skia tools and benchmarks. |
| 115 | cc_defaults { |
| 116 | name: "skia_pgo_no_profile_use", |
| 117 | defaults: [ |
| 118 | "skia_pgo", |
| 119 | ], |
| 120 | pgo: { |
| 121 | enable_profile_use: false, |
| 122 | }, |
| 123 | } |
| 124 | |
Derek Sollenberger | 5a93216 | 2017-09-21 14:25:14 -0400 | [diff] [blame] | 125 | cc_defaults { |
| 126 | name: "skia_deps", |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 127 | shared_libs: [ |
| 128 | "libEGL", |
| 129 | "libGLESv2", |
| 130 | "libdng_sdk", |
| 131 | "libexpat", |
| 132 | "libft2", |
Leon Scroggins III | 04be2b5 | 2017-08-17 15:13:20 -0400 | [diff] [blame] | 133 | "libheif", |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 134 | "libicui18n", |
| 135 | "libicuuc", |
| 136 | "libjpeg", |
| 137 | "liblog", |
| 138 | "libpiex", |
| 139 | "libpng", |
| 140 | "libvulkan", |
| 141 | "libz", |
Derek Sollenberger | 488f0d6 | 2017-03-03 15:48:33 -0500 | [diff] [blame] | 142 | "libcutils", |
Stan Iliev | 7e910df | 2017-06-02 10:29:21 -0400 | [diff] [blame] | 143 | "libnativewindow", |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 144 | ], |
| 145 | static_libs: [ |
Matt Sarett | a309109 | 2017-02-20 12:50:52 -0500 | [diff] [blame] | 146 | "libarect", |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 147 | "libsfntly", |
| 148 | "libwebp-decode", |
| 149 | "libwebp-encode", |
| 150 | ], |
Derek Sollenberger | 5a93216 | 2017-09-21 14:25:14 -0400 | [diff] [blame] | 151 | group_static_libs: true, |
| 152 | } |
| 153 | |
| 154 | cc_defaults { |
| 155 | name: "skia_tool_deps", |
| 156 | defaults: [ |
Pirama Arumuga Nainar | de2b95e | 2017-12-13 11:07:39 -0800 | [diff] [blame] | 157 | "skia_deps", |
| 158 | "skia_pgo_no_profile_use" |
Derek Sollenberger | 5a93216 | 2017-09-21 14:25:14 -0400 | [diff] [blame] | 159 | ], |
| 160 | static_libs: [ |
| 161 | "libjsoncpp", |
| 162 | "libskia", |
| 163 | ], |
| 164 | cflags: [ |
Derek Sollenberger | 9a72ae1 | 2017-12-14 13:01:30 -0500 | [diff] [blame] | 165 | "-Wno-unused-parameter", |
| 166 | "-Wno-unused-variable", |
Derek Sollenberger | 5a93216 | 2017-09-21 14:25:14 -0400 | [diff] [blame] | 167 | ], |
Leon Scroggins III | 6ccd2ca | 2017-01-26 17:21:27 -0500 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | cc_test { |
| 171 | name: "skia_dm", |
| 172 | |
Derek Sollenberger | 5a93216 | 2017-09-21 14:25:14 -0400 | [diff] [blame] | 173 | defaults: [ |
| 174 | "skia_tool_deps" |
Leon Scroggins III | 6ccd2ca | 2017-01-26 17:21:27 -0500 | [diff] [blame] | 175 | ], |
| 176 | |
| 177 | local_include_dirs: [ |
| 178 | $dm_includes |
| 179 | ], |
| 180 | |
| 181 | srcs: [ |
| 182 | $dm_srcs |
| 183 | ], |
Leon Scroggins III | 6ccd2ca | 2017-01-26 17:21:27 -0500 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | cc_test { |
| 187 | name: "skia_nanobench", |
| 188 | |
Derek Sollenberger | 5a93216 | 2017-09-21 14:25:14 -0400 | [diff] [blame] | 189 | defaults: [ |
| 190 | "skia_tool_deps" |
Leon Scroggins III | 6ccd2ca | 2017-01-26 17:21:27 -0500 | [diff] [blame] | 191 | ], |
| 192 | |
| 193 | local_include_dirs: [ |
| 194 | $nanobench_includes |
| 195 | ], |
| 196 | |
| 197 | srcs: [ |
| 198 | $nanobench_srcs |
| 199 | ], |
Pirama Arumuga Nainar | 68c3fac | 2018-01-09 21:05:55 -0800 | [diff] [blame] | 200 | |
| 201 | data: [ |
| 202 | "resources/*", |
| 203 | ], |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 204 | }''') |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 205 | |
| 206 | # We'll run GN to get the main source lists and include directories for Skia. |
| 207 | gn_args = { |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 208 | 'is_official_build': 'true', |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 209 | 'skia_enable_tools': 'true', |
Leon Scroggins III | 04be2b5 | 2017-08-17 15:13:20 -0400 | [diff] [blame] | 210 | 'skia_use_libheif': 'true', |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 211 | 'skia_use_vulkan': 'true', |
| 212 | 'target_cpu': '"none"', |
| 213 | 'target_os': '"android"', |
Greg Daniel | afb7ec7 | 2017-12-07 12:48:30 -0500 | [diff] [blame] | 214 | 'skia_vulkan_header': '"Skia_Vulkan_Android.h"', |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 215 | } |
| 216 | gn_args = ' '.join(sorted('%s=%s' % (k,v) for (k,v) in gn_args.iteritems())) |
| 217 | |
| 218 | tmp = tempfile.mkdtemp() |
| 219 | subprocess.check_call(['gn', 'gen', tmp, '--args=%s' % gn_args, '--ide=json']) |
| 220 | |
| 221 | js = json.load(open(os.path.join(tmp, 'project.json'))) |
| 222 | |
| 223 | def strip_slashes(lst): |
Ben Wagner | e127523 | 2017-02-23 18:00:06 -0500 | [diff] [blame] | 224 | return {str(p.lstrip('/')) for p in lst} |
Mike Klein | 27eb22b | 2016-12-07 12:27:56 -0500 | [diff] [blame] | 225 | |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 226 | srcs = strip_slashes(js['targets']['//:skia']['sources']) |
Leon Scroggins III | 981a31e | 2017-10-06 11:53:53 -0400 | [diff] [blame] | 227 | cflags = strip_slashes(js['targets']['//:skia']['cflags']) |
| 228 | cflags_cc = strip_slashes(js['targets']['//:skia']['cflags_cc']) |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 229 | local_includes = strip_slashes(js['targets']['//:skia']['include_dirs']) |
| 230 | export_includes = strip_slashes(js['targets']['//:public']['include_dirs']) |
| 231 | |
Leon Scroggins III | 6ccd2ca | 2017-01-26 17:21:27 -0500 | [diff] [blame] | 232 | dm_srcs = strip_slashes(js['targets']['//:dm']['sources']) |
| 233 | dm_includes = strip_slashes(js['targets']['//:dm']['include_dirs']) |
| 234 | |
| 235 | nanobench_target = js['targets']['//:nanobench'] |
| 236 | nanobench_srcs = strip_slashes(nanobench_target['sources']) |
| 237 | nanobench_includes = strip_slashes(nanobench_target['include_dirs']) |
| 238 | |
| 239 | def GrabDependentSrcs(name, srcs_to_extend, exclude): |
| 240 | # Grab the sources from other targets that $name depends on (e.g. optional |
| 241 | # Skia components, gms, tests, etc). |
| 242 | for dep in js['targets'][name]['deps']: |
| 243 | if 'third_party' in dep: |
| 244 | continue # We've handled all third-party DEPS as static or shared_libs. |
| 245 | if 'none' in dep: |
| 246 | continue # We'll handle all cpu-specific sources manually later. |
| 247 | if exclude and exclude in dep: |
| 248 | continue |
Ben Wagner | e127523 | 2017-02-23 18:00:06 -0500 | [diff] [blame] | 249 | srcs_to_extend.update(strip_slashes(js['targets'][dep].get('sources', []))) |
| 250 | GrabDependentSrcs(dep, srcs_to_extend, exclude) |
Leon Scroggins III | 6ccd2ca | 2017-01-26 17:21:27 -0500 | [diff] [blame] | 251 | |
| 252 | GrabDependentSrcs('//:skia', srcs, None) |
| 253 | GrabDependentSrcs('//:dm', dm_srcs, 'skia') |
| 254 | GrabDependentSrcs('//:nanobench', nanobench_srcs, 'skia') |
Mike Klein | 27eb22b | 2016-12-07 12:27:56 -0500 | [diff] [blame] | 255 | |
| 256 | # No need to list headers. |
Ben Wagner | e127523 | 2017-02-23 18:00:06 -0500 | [diff] [blame] | 257 | srcs = {s for s in srcs if not s.endswith('.h')} |
| 258 | dm_srcs = {s for s in dm_srcs if not s.endswith('.h')} |
| 259 | nanobench_srcs = {s for s in nanobench_srcs if not s.endswith('.h')} |
Mike Klein | 27eb22b | 2016-12-07 12:27:56 -0500 | [diff] [blame] | 260 | |
Leon Scroggins III | 981a31e | 2017-10-06 11:53:53 -0400 | [diff] [blame] | 261 | # Only use the generated flags related to warnings. |
| 262 | cflags = {s for s in cflags if s.startswith('-W')} |
| 263 | cflags_cc = {s for s in cflags_cc if s.startswith('-W')} |
| 264 | # Add the rest of the flags we want. |
| 265 | cflags = cflags.union([ |
| 266 | "-fvisibility=hidden", |
| 267 | "-D_FORTIFY_SOURCE=1", |
| 268 | "-DSKIA_DLL", |
| 269 | "-DSKIA_IMPLEMENTATION=1", |
| 270 | "-DATRACE_TAG=ATRACE_TAG_VIEW", |
Leon Scroggins III | 7a10b33 | 2018-01-12 11:24:30 -0500 | [diff] [blame] | 271 | "-DSK_PRINT_CODEC_MESSAGES", |
Leon Scroggins III | 981a31e | 2017-10-06 11:53:53 -0400 | [diff] [blame] | 272 | ]) |
| 273 | cflags_cc.add("-fexceptions") |
| 274 | |
| 275 | # We need to undefine FORTIFY_SOURCE before we define it. Insert it at the |
| 276 | # beginning after sorting. |
| 277 | cflags = sorted(cflags) |
| 278 | cflags.insert(0, "-U_FORTIFY_SOURCE") |
| 279 | |
Greg Daniel | afb7ec7 | 2017-12-07 12:48:30 -0500 | [diff] [blame] | 280 | # We need to add the include path to the vulkan defines and header file set in |
| 281 | # then skia_vulkan_header gn arg that is used for framework builds. |
| 282 | local_includes.add("platform_tools/android/vulkan") |
| 283 | export_includes.add("platform_tools/android/vulkan") |
| 284 | |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 285 | # Most defines go into SkUserConfig.h, where they're seen by Skia and its users. |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 286 | defines = [str(d) for d in js['targets']['//:skia']['defines']] |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 287 | defines.remove('NDEBUG') # Let the Android build control this. |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 288 | defines.remove('SKIA_IMPLEMENTATION=1') # Only libskia should have this define. |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 289 | |
| 290 | # For architecture specific files, it's easier to just read the same source |
| 291 | # that GN does (opts.gni) rather than re-run GN once for each architecture. |
| 292 | |
| 293 | # This .gni file we want to read is close enough to Python syntax |
| 294 | # that we can use execfile() if we supply definitions for GN builtins. |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 295 | |
| 296 | def get_path_info(path, kind): |
| 297 | assert kind == "abspath" |
| 298 | # While we want absolute paths in GN, relative paths work best here. |
| 299 | return path |
| 300 | |
| 301 | builtins = { 'get_path_info': get_path_info } |
| 302 | defs = {} |
Leon Scroggins III | 4f8a467 | 2016-12-19 09:32:21 -0500 | [diff] [blame] | 303 | here = os.path.dirname(__file__) |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 304 | execfile(os.path.join(here, 'opts.gni'), builtins, defs) |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 305 | |
Mike Klein | 27eb22b | 2016-12-07 12:27:56 -0500 | [diff] [blame] | 306 | # Turn paths from opts.gni into paths relative to external/skia. |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 307 | def scrub(lst): |
| 308 | # Perform any string substitutions. |
| 309 | for var in defs: |
| 310 | if type(defs[var]) is str: |
| 311 | lst = [ p.replace('$'+var, defs[var]) for p in lst ] |
| 312 | # Relativize paths to top-level skia/ directory. |
| 313 | return [os.path.relpath(p, '..') for p in lst] |
| 314 | |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 315 | # Turn a list of strings into the style bpfmt outputs. |
Leon Scroggins III | 6ccd2ca | 2017-01-26 17:21:27 -0500 | [diff] [blame] | 316 | def bpfmt(indent, lst, sort=True): |
| 317 | if sort: |
| 318 | lst = sorted(lst) |
| 319 | return ('\n' + ' '*indent).join('"%s",' % v for v in lst) |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 320 | |
| 321 | # OK! We have everything to fill in Android.bp... |
| 322 | with open('Android.bp', 'w') as f: |
| 323 | print >>f, bp.substitute({ |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 324 | 'export_includes': bpfmt(8, export_includes), |
| 325 | 'local_includes': bpfmt(8, local_includes), |
| 326 | 'srcs': bpfmt(8, srcs), |
Leon Scroggins III | 981a31e | 2017-10-06 11:53:53 -0400 | [diff] [blame] | 327 | 'cflags': bpfmt(8, cflags, False), |
| 328 | 'cflags_cc': bpfmt(8, cflags_cc), |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 329 | |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 330 | 'arm_srcs': bpfmt(16, scrub(defs['armv7'])), |
| 331 | 'arm_neon_srcs': bpfmt(20, scrub(defs['neon'])), |
| 332 | 'arm64_srcs': bpfmt(16, scrub(defs['arm64'] + |
| 333 | defs['crc32'])), |
Mike Klein | 40a82bd | 2016-12-20 17:34:29 -0500 | [diff] [blame] | 334 | 'none_srcs': bpfmt(16, scrub(defs['none'])), |
Mike Klein | ee43f6f | 2016-12-12 14:09:38 -0500 | [diff] [blame] | 335 | 'x86_srcs': bpfmt(16, scrub(defs['sse2'] + |
| 336 | defs['ssse3'] + |
| 337 | defs['sse41'] + |
| 338 | defs['sse42'] + |
Mike Reed | e32500f | 2017-07-19 17:20:37 -0400 | [diff] [blame] | 339 | defs['avx' ])), |
Leon Scroggins III | 6ccd2ca | 2017-01-26 17:21:27 -0500 | [diff] [blame] | 340 | |
Leon Scroggins III | 6ccd2ca | 2017-01-26 17:21:27 -0500 | [diff] [blame] | 341 | 'dm_includes' : bpfmt(8, dm_includes), |
| 342 | 'dm_srcs' : bpfmt(8, dm_srcs), |
| 343 | |
| 344 | 'nanobench_includes' : bpfmt(8, nanobench_includes), |
| 345 | 'nanobench_srcs' : bpfmt(8, nanobench_srcs), |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 346 | }) |
| 347 | |
| 348 | #... and all the #defines we want to put in SkUserConfig.h. |
Mike Klein | c308333 | 2016-12-12 09:03:56 -0500 | [diff] [blame] | 349 | with open('include/config/SkUserConfig.h', 'w') as f: |
Leon Scroggins III | 51b2f1b | 2017-07-11 15:53:41 -0400 | [diff] [blame] | 350 | print >>f, '// DO NOT MODIFY! This file is autogenerated by gn_to_bp.py.' |
| 351 | print >>f, '// If need to change a define, modify SkUserConfigManual.h' |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 352 | print >>f, '#ifndef SkUserConfig_DEFINED' |
| 353 | print >>f, '#define SkUserConfig_DEFINED' |
Leon Scroggins III | 51b2f1b | 2017-07-11 15:53:41 -0400 | [diff] [blame] | 354 | print >>f, '#include "SkUserConfigManual.h"' |
Mike Klein | 27eb22b | 2016-12-07 12:27:56 -0500 | [diff] [blame] | 355 | for define in sorted(defines): |
Mike Klein | c308333 | 2016-12-12 09:03:56 -0500 | [diff] [blame] | 356 | print >>f, ' #define', define.replace('=', ' ') |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 357 | print >>f, '#endif//SkUserConfig_DEFINED' |