In the build there are some defaults which actually apply to every
use of a built-in target type, but there are some (particularaly
warnings) which apply only to targets controlled by Skia. Currently
these unwanted defaults are magically known to exist and removed
wherever they are not wanted. Instead, create 'skia_' prefixed target
templates and apply these defaults to those instead.
Change-Id: I3a2afb53c7205a2e2748d1cfad46319f2e93d3b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385516
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Some users of Skia want to build these with -I instead of -isystem, and
until now we've piggybacked it on werror, but it's still kind of
annoying to see warnings even if they're not fatal.
Change-Id: I5a349b2571adc2f94c75dc17317666ddc2dec373
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297788
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This introduces a 'third_party_config' gn template which forwards any
include_dirs as cflag system dirs. This is then used on the dawn and
shaderc configs to suppress warnings from use of their headers in Skia.
This route was chosen as a way to minimize the diff with the upstream
BUILD.gn files for these projects for easier updates.
It would be nice if gn could handle this in the build system, since it
isn't good to hide include directories from gn this way. The gn issue
https://bugs.chromium.org/p/gn/issues/detail?id=157 was created to track
gn being able to do this in a cleaner way.
Change-Id: I2d17d099db7b3d8b5a960576ca0535a22badd902
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281356
Auto-Submit: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit e990fcc4b0.
Reason for revert: Build-Win-Clang-x86_64-Release-Shared
Original change's description:
> Enable deprecated-copy-dtor warning.
>
> In C++11 a user declared destructor still requires the compiler to
> implicitly default the copy constructor and copy assignment operator,
> but this is deprecated. Note that a user declared destructor suppresses
> the move constructor and move assignment operator; a user declared
> destructor exists if any '~Foo' method declaration appears inside
> 'class Foo' (even if defaulted); if the copy and move operations are the
> same then copy operations that take 'const Foo&' will do fine double
> duty as move operations.
>
> Clang seems to have an issue with this warning, in that it does not
> appear to distinguish between compiler defaulted and user defaulted
> destructors. As a result, it does not always warn when it should.
> There may yet be places in the code where a move operation is desired
> but may be suppressed because the implicitly defaulted moves are not
> declared because a destructor has been declared.
>
> This wraps dawn and shaderc configs in 'third_party' so that their
> headers will be included through '-isystem' in order to avoid the
> warnings generated by including their headers.
>
> Change-Id: I681524cd890d86305aa99b6b765a52113b4dfa4b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280406
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
TBR=mtklein@google.com,bsalomon@google.com,bungeman@google.com
Change-Id: Icd6a2487637d21fcf7c4c7ab7cba7a8adfda5afd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280836
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
In C++11 a user declared destructor still requires the compiler to
implicitly default the copy constructor and copy assignment operator,
but this is deprecated. Note that a user declared destructor suppresses
the move constructor and move assignment operator; a user declared
destructor exists if any '~Foo' method declaration appears inside
'class Foo' (even if defaulted); if the copy and move operations are the
same then copy operations that take 'const Foo&' will do fine double
duty as move operations.
Clang seems to have an issue with this warning, in that it does not
appear to distinguish between compiler defaulted and user defaulted
destructors. As a result, it does not always warn when it should.
There may yet be places in the code where a move operation is desired
but may be suppressed because the implicitly defaulted moves are not
declared because a destructor has been declared.
This wraps dawn and shaderc configs in 'third_party' so that their
headers will be included through '-isystem' in order to avoid the
warnings generated by including their headers.
Change-Id: I681524cd890d86305aa99b6b765a52113b4dfa4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280406
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Apply -fsanitize-recover=pointer-overflow to third_party code only.
I'm trying to keep Skia behaving the same, avoiding illegal nullptr+k:
- Add null check in SkJSON fast string path.
- Add null check (first alloc) and some comments to SkArenaAlloc.
- March an int index instead dst pointer in SkBase64.
Bug: skia:9731
Change-Id: I646635558ea63ded846b746f2a1f0b4f1e1eacff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268109
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This was a workaround for older MSVC that didn't suppress that
particular warning as part of "/w". Bots are using a newer compiler that
fixes the issue.
Change-Id: If8582a688294286c2b307970415cd1d929b184b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261738
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Updating the bots to MSVC 2019 requires a newer ICU (to fix an issue
with usage of std::atomic), and updating ICU requires updating HB.
Change-Id: I889add046b957d7699cb8c3cafb9dd91b3e588d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261540
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
We've failed to get these bots to report where issues happen
any more finely than the name of the executable, which makes
them a real pain to fix when they go red.
We don't expect we'll be able to run cleanly in this mode for
long without bots enforcing it, so remove support from GN too.
Change-Id: Ie86f0cbf2f5f859ac2ddb869da7e5b8d31b33fa0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237195
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This will ensure that the headers from the dependencies will have
precedent over system headers, thus preventing situations where system
headers will block dependency headers and prevent compilation.
Change-Id: I0d480a6d3898f2da99cf2706c5335aaac05b4e4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220276
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
We previously moved them to only being added via -isystem
(and -imsvc). This prevents warnings in those headers from
breaking our builds, which is good.
However, when generating Visual Studio project files, GN
doesn't know about those switches, so it omits these paths.
Propagating to include_dirs causes them to be added, and
fixes include path and symbol resolution in the IDE.
Change-Id: Id261bec8f91d2eaca60dbc6c3e8628e9608826ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212762
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This should disable warnings from third-party headers
on Clang/Win builds. So far we've just gotten lucky.
Change-Id: Ieaf459e200925d46d8c65ba8d489db111705b125
Reviewed-on: https://skia-review.googlesource.com/c/191283
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This enables four different options in the compiler, described
below. I also added enough masks to satisfy RTCc when running
all GMs in both 8888 and gl configs.
---
/RTCc - Detects when a value is assigned to a smaller data
type and results in data loss. This happens even when casting.
Masking is required to suppress this.
/RTCs - Various stack-related checks, including uninitialized
data (by initializing locals to a non-zero value), array bounds
checking, and stack pointer corruption that can occur with a
calling convention mismatch.
/RTCu - Reports when a variable is used without having been
initialized. Mostly redundant with compile-time checks.
/guard:cf - This is more of a security option, that computes
all possible targets for indirect calls at compile time, and
verifies that those are the only targets reached at compile
time. Also generates similar logic around switch statements
that turn into jump tables.
Bug: skia:
Change-Id: I7b527af8fd67dec0b6556f38bcd0efc3fd505856
Reviewed-on: https://skia-review.googlesource.com/c/188625
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit 32a71f126f.
Since more static_libraries are created, we use
target_link_libraries more, which passes the transitive
dependencies.
Bug: skia:8732
Change-Id: I1d05f89b078f5116545306a930b65ca4b5b29e8e
Reviewed-on: https://skia-review.googlesource.com/c/188623
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This reverts commit e738bf1139.
Reason for revert: Breaks CLION's cmake builds
This affects the Clion users Herb and Brian.
I talked with Kevin, and he thought we should revert this change.
Original change's description:
> make third_party() static libraries
>
> It's sometimes nice to have a libfoo.a to work with.
>
> I've had to borrow a trick from Chromium's component template [1] to
> avoid trying to make static libraries for header or config only targets.
>
> [1] https://cs.chromium.org/chromium/src/build/config/BUILDCONFIG.gn?rcl=ebf3d7e5827761e1f540cc788bbe301e0f6cc674&l=596
>
> Change-Id: I9ec46089c7a4d0a5194ef8ac262dadac10508786
> Reviewed-on: https://skia-review.googlesource.com/c/188024
> Commit-Queue: Mike Klein <mtklein@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Auto-Submit: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,kjlubick@google.com
Change-Id: I3fd49b78c0d4e28d805bdc70d8405b1e991cb413
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/188140
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This is a reland of c766370d86
Original change's description:
> always optimize third_party code
>
> Change-Id: I5b2244460a4760e9336640f597d0f74c374a0d04
> Reviewed-on: https://skia-review.googlesource.com/155641
> Commit-Queue: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I63e7f9ca852fc99728d7a01d9987b3506115d266
Reviewed-on: https://skia-review.googlesource.com/155760
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit c766370d86.
Reason for revert: speculative -- trying to fix Debian breaks (pdf?)
Original change's description:
> always optimize third_party code
>
> Change-Id: I5b2244460a4760e9336640f597d0f74c374a0d04
> Reviewed-on: https://skia-review.googlesource.com/155641
> Commit-Queue: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=mtklein@google.com,brianosman@google.com
Change-Id: I5467c95f9487c31e6f538f13579e490cdaeeee2e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/155607
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Change-Id: I5b2244460a4760e9336640f597d0f74c374a0d04
Reviewed-on: https://skia-review.googlesource.com/155641
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
People using is_official_build don't really want to see warnings.
They're for devs, not users.
The somewhat odd update to gn/BUILDCONFIG.gn keeps command
line flag precedence (later == more important) unchanged.
Change-Id: I1a04a35f066b7408021d474535f0dbf4928e21d3
Reviewed-on: https://skia-review.googlesource.com/151380
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
improved third_party template to include headers as system headers for non-Windows machines
Bug: skia:
Change-Id: Id2fa74fc31b49f9b07cc83e7f60477c7ab4f8d83
Reviewed-on: https://skia-review.googlesource.com/135450
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Revert "use -isystem for headers from third_party"
This reverts commit 138bd155ed.
Revert "write -isystem paths relative to the build root"
This reverts commit 085bc52363.
I suspect the first breaks building on systems with an old libpng
or zlib installed, and the second definitely breaks GN -> CMake.
Change-Id: I5b29669b21b1444daeec8fb784337422ee17311a
Reviewed-on: https://skia-review.googlesource.com/110183
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
The default makes these system-absolute paths,
which confuses fiddle's overlay builds.
Now we should see things like,
-isystem ../third_party/externals/jsoncpp/include
where we previously had,
-isystem /Users/mtklein/skia/third_party/externals/jsoncpp/include
Change-Id: I7b161a550fdb95b06e17c372cd5bec3015e3c8b7
Reviewed-on: https://skia-review.googlesource.com/109382
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This supresses warnings from code in those headers,
e.g. warnings about switch case fallthrough in SDL_memset4(),
defined inline in SDL_stdinc.h.
Change-Id: I5341a67d4949b28ec5ffa6b7ae433748406e99db
Reviewed-on: https://skia-review.googlesource.com/109140
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This extends the pattern in freetype2 to expat, icu, libjpeg-turbo, libpng, libwebp, and zlib, and gives all these an arg to control which to use.
Homebrew doesn't have dng_sdk, piex, or sftnly, or I'd have done the same for them too.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4260
DOCS_PREVIEW= https://skia.org/?cl=4260
Change-Id: I82e780502bf2217336e791787f172a6fc8f55460
Reviewed-on: https://skia-review.googlesource.com/4260
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Hal Canary <halcanary@google.com>
CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Win-MSVC-x86-Debug-Exceptions-Trybot,Build-Win-MSVC-x86_64-Debug-GN-Trybot,Build-Win-MSVC-x86_64-Release-GN-Trybot
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3258
Change-Id: Ia2b85904bed1e6ca72c68abaecf6c2854795342c
Reviewed-on: https://skia-review.googlesource.com/3258
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This builds, links, and runs on Linux. Have not tried Mac.
I've tested is_debug={true,false} and is_component_build.
It's neat that the component build DM works, but it's also an indication I've missed an essential flag or two... it shouldn't work. :)
The GPU backend isn't working yet, but all the software configurations I've tried look good.
This fleshes out all the other parts of SkCodec too... I noticed we weren't able to decode gifs or webp.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2188643002
Review-Url: https://codereview.chromium.org/2188643002
This sketches out what a world without Chrome's GN configs would look like.
Instead of DEPSing in build/, we now host our own gypi_to_gn.py.
The symlink from skia/ to . lets us run gclient hooks when the .gclient file is in the directory above skia/ or inside skia/. That means we don't need gn.py anymore.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2167163002
Review-Url: https://codereview.chromium.org/2167163002
This fixes the build on Linux (dep on third_party:zlib -> third_party/zlib).
I've moved declare_args() {} back to each .gn file... seems like args want
to be as local as possible in GN land.
Additionally, refactor all the common third_party config and warning flag
changes into a template, third_party. This lets it all live together in a
.gni: at head unwanted_configs can be in a .gni (it's just a variable) but
config("no_warnings") (and thus third_party_configs) cannot, as configs
cannot be part of .gni files.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2163653002
Review-Url: https://codereview.chromium.org/2163653002