Commit Graph

24 Commits

Author SHA1 Message Date
Shachar Langbeheim
db610b3038 third-party.gni: Search includes using -I.
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>
2019-06-11 19:04:29 +00:00
Brian Osman
8cdf5b6fa4 Propagate third_party public_include_dirs to include_dirs
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>
2019-05-08 19:57:44 +00:00
Mike Klein
10af5ecfaa use /imsvc with clang-cl where we use -isystem
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>
2019-02-11 18:34:32 +00:00
Brian Osman
50ea3c06b8 Add support for MSVC run-time checks (and control flow guard)
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>
2019-02-04 20:55:24 +00:00
Kevin Lubick
d5c6e16e3e Revert "Revert "make third_party() static libraries""
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>
2019-02-01 21:12:50 +00:00
Herb Derby
32a71f126f Revert "make third_party() static libraries"
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>
2019-01-30 19:09:03 +00:00
Mike Klein
e738bf1139 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>
2019-01-30 16:27:21 +00:00
Mike Klein
7ea977bc5e Reland "always optimize third_party code"
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>
2018-09-20 23:21:01 +00:00
Mike Reed
5d032ecb8f Revert "always optimize third_party code"
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>
2018-09-19 19:55:58 +00:00
Mike Klein
c766370d86 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>
2018-09-19 18:09:55 +00:00
Mike Klein
d84c1e65a6 drop warnings and -Werror from is_official_builds
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>
2018-09-04 15:46:42 +00:00
Brian Osman
c069a57301 added NIMA sample to showcase animations
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>
2018-06-19 20:30:28 +00:00
Mike Klein
5279cdf190 Revert -isystem related CLs.
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>
2018-02-26 15:33:17 +00:00
Mike Klein
085bc52363 write -isystem paths relative to the build root
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>
2018-02-22 16:06:32 +00:00
Mike Klein
138bd155ed use -isystem for headers from third_party
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>
2018-02-21 20:40:36 +00:00
Mike Klein
10d665d000 Allow most third_party targets to use system libraries if asked.
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>
2016-11-01 16:17:38 +00:00
Mike Klein
c7165c239a GN/Win: warnings and warn-as-error
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>
2016-10-13 04:17:38 +00:00
Mike Klein
4b167fc850 GN/Win: everything but skiaserve links.
BUG=skia:

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

Change-Id: I85c306f89f3a7faa7f50dadf465122844d015604
Reviewed-on: https://skia-review.googlesource.com/3240
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-10-11 22:37:40 +00:00
herb
b6318bf44d Compile the skia library for windows using gn.
TBR=mtklein@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2347443002

Review-Url: https://codereview.chromium.org/2347443002
2016-09-16 13:29:57 -07:00
halcanary
19a9720978 GN: build sfntly, icu, harfbuzz
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2200833010

Review-Url: https://codereview.chromium.org/2200833010
2016-08-03 15:08:04 -07:00
mtklein
25c81d4e65 GN: dm
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
2016-07-27 13:55:27 -07:00
mtklein
7fbfbbe8f4 Basic standalone GN configs.
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
2016-07-21 12:25:45 -07:00
mtklein
f037d48e29 GN: refactor third_party/gni
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
2016-07-19 08:25:00 -07:00
abarth
6fc8ff024b Add support for Fuchsia
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2152273002

[mtklein edit from here down]
No public API changes.
TBR=reed@google.com

Review-Url: https://codereview.chromium.org/2152273002
2016-07-15 15:15:15 -07:00