Turn on flags to enforce SK_API.

These flags hide symbols that are not marked with SK_API when linked into a
shared library.  There's nominally no effect on static linking, but I'm
pretty sure the Mac linker takes some advantage of this too to run faster.

This makes component-build DM no longer link: it uses many non SK_API APIs.
Fiddle in contrast is just fine with our public APIs, so no need to restrict that.

It'll be fun finding out which of our other tools go which ways.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2180383003

Review-Url: https://codereview.chromium.org/2180383003
This commit is contained in:
mtklein 2016-07-27 14:59:08 -07:00 committed by Commit bot
parent 4b1e17edc7
commit 8796ff1fbc
2 changed files with 23 additions and 19 deletions

View File

@ -400,24 +400,26 @@ test_lib("gm") {
]
}
executable("dm") {
sources = [
"dm/DM.cpp",
"dm/DMJsonWriter.cpp",
"dm/DMSrcSink.cpp",
if (!is_component_build) { # DM uses many non-SK_API APIs...
executable("dm") {
sources = [
"dm/DM.cpp",
"dm/DMJsonWriter.cpp",
"dm/DMSrcSink.cpp",
# TODO: tests for real
"tests/Test.cpp",
]
include_dirs = [ "tests" ]
deps = [
":flags",
":gm",
":gpu_tool_utils",
":skia",
":tool_utils",
"//third_party/jsoncpp",
"//third_party/libpng",
]
testonly = true
# TODO: tests for real
"tests/Test.cpp",
]
include_dirs = [ "tests" ]
deps = [
":flags",
":gm",
":gpu_tool_utils",
":skia",
":tool_utils",
"//third_party/jsoncpp",
"//third_party/libpng",
]
testonly = true
}
}

View File

@ -14,6 +14,7 @@ config("default") {
"-g",
"-fstrict-aliasing",
"-fPIC",
"-fvisibility=hidden",
"-Werror",
"-Wall",
@ -31,6 +32,7 @@ config("default") {
"-fno-exceptions",
"-fno-rtti",
"-fno-threadsafe-statics",
"-fvisibility-inlines-hidden",
"-Wnon-virtual-dtor",
]