diff options
-rw-r--r-- | gn/gn_to_bp.py | 35 | ||||
-rw-r--r-- | src/gpu/GrProcessor.cpp | 2 | ||||
-rw-r--r-- | src/gpu/ops/GrOp.cpp | 2 |
3 files changed, 31 insertions, 8 deletions
diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py index f0a28a8941..239fb020fd 100644 --- a/gn/gn_to_bp.py +++ b/gn/gn_to_bp.py @@ -21,14 +21,11 @@ bp = string.Template('''// This file is autogenerated by gn_to_bp.py. cc_library_static { name: "libskia", cflags: [ - "-fexceptions", - "-fvisibility=hidden", - "-Wno-unused-parameter", - "-U_FORTIFY_SOURCE", - "-D_FORTIFY_SOURCE=1", - "-DSKIA_DLL", - "-DSKIA_IMPLEMENTATION=1", - "-DATRACE_TAG=ATRACE_TAG_VIEW", + $cflags + ], + + cppflags:[ + $cflags_cc ], export_include_dirs: [ @@ -185,6 +182,8 @@ def strip_slashes(lst): return {str(p.lstrip('/')) for p in lst} srcs = strip_slashes(js['targets']['//:skia']['sources']) +cflags = strip_slashes(js['targets']['//:skia']['cflags']) +cflags_cc = strip_slashes(js['targets']['//:skia']['cflags_cc']) local_includes = strip_slashes(js['targets']['//:skia']['include_dirs']) export_includes = strip_slashes(js['targets']['//:public']['include_dirs']) @@ -217,6 +216,24 @@ srcs = {s for s in srcs if not s.endswith('.h')} 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')} +# Only use the generated flags related to warnings. +cflags = {s for s in cflags if s.startswith('-W')} +cflags_cc = {s for s in cflags_cc if s.startswith('-W')} +# Add the rest of the flags we want. +cflags = cflags.union([ + "-fvisibility=hidden", + "-D_FORTIFY_SOURCE=1", + "-DSKIA_DLL", + "-DSKIA_IMPLEMENTATION=1", + "-DATRACE_TAG=ATRACE_TAG_VIEW", +]) +cflags_cc.add("-fexceptions") + +# We need to undefine FORTIFY_SOURCE before we define it. Insert it at the +# beginning after sorting. +cflags = sorted(cflags) +cflags.insert(0, "-U_FORTIFY_SOURCE") + # Most defines go into SkUserConfig.h, where they're seen by Skia and its users. defines = [str(d) for d in js['targets']['//:skia']['defines']] defines.remove('NDEBUG') # Let the Android build control this. @@ -259,6 +276,8 @@ with open('Android.bp', 'w') as f: 'export_includes': bpfmt(8, export_includes), 'local_includes': bpfmt(8, local_includes), 'srcs': bpfmt(8, srcs), + 'cflags': bpfmt(8, cflags, False), + 'cflags_cc': bpfmt(8, cflags_cc), 'arm_srcs': bpfmt(16, scrub(defs['armv7'])), 'arm_neon_srcs': bpfmt(20, scrub(defs['neon'])), diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp index 7ea597221b..b8ca63e7a9 100644 --- a/src/gpu/GrProcessor.cpp +++ b/src/gpu/GrProcessor.cpp @@ -93,7 +93,9 @@ void GrXPFactoryTestFactory::VerifyFactoryCount() { // memory barrier between accesses of a context on different threads. Also, there may be multiple // GrContexts and those contexts may be in use concurrently on different threads. namespace { +#if !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) static SkSpinlock gProcessorSpinlock; +#endif class MemoryPoolAccessor { public: diff --git a/src/gpu/ops/GrOp.cpp b/src/gpu/ops/GrOp.cpp index 7762a5a840..798d29d358 100644 --- a/src/gpu/ops/GrOp.cpp +++ b/src/gpu/ops/GrOp.cpp @@ -20,7 +20,9 @@ // memory barrier between accesses of a context on different threads. Also, there may be multiple // GrContexts and those contexts may be in use concurrently on different threads. namespace { +#if !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) static SkSpinlock gOpPoolSpinLock; +#endif class MemoryPoolAccessor { public: |