Commit Graph

66 Commits

Author SHA1 Message Date
mtklein
1ee76510f5 Start making all .cpp files compile-able on all platforms.
I sometimes dream to hone our build process down to something as simple as
    $ find src -name '*.cpp' | xargs c++ <some cflags> -c -o skia.o

To start, it helps if we can compile all files on all platforms.  Each
non-portable file guards itself with defines provided by SkTypes.h.  This does
not convert all non-portable code, but it's a good representative chunk.

E.g. instead of having to remember which SkDebug_*.cpp to compile on which
platform we can just compile all three and let the code itself sort it out.

This has the nice side effect of making non-portable code declare the
conditions under which it can compile explicitly.

I've been testing mostly with the CMake build as it's easiest, but this should
apply equally to BUILD, Gyp, and GN files... to any build system really.

BUG=skia:4269
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1411283005
2015-11-02 10:20:27 -08:00
mtklein
e092cee9ad CMake: exclude SkOSLibrary_posix.cpp on Windows too.
BUG=skia:
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1414983004
2015-10-26 08:41:10 -07:00
mtklein
a1bde7d2e1 Remove SkThread::setProcessorAffinity()
It's only used by a couple unit tests.  We have other ways of getting
the same quality testing of our ref-count code now (e.g. TSAN).

BUG=skia:
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1408213005
2015-10-20 11:05:06 -07:00
mtklein
56c6a117b2 CMake for Windows
Except for some small edits, this is mainly:

patch from issue 1353953004 at patchset 80001 (http://crrev.com/1353953004#ps80001)

CMake configuration file for compiling Windows x64 VS2013 with CMake.

Things to be fixed:
- only x64 is supported
- I didn't try SKIA_GDI (experimental) and directly went for the DirectWrite - this should need an option in the CMake configuration
- make sure yasm and custom build rules paths are set correctly - if the hierarchy changes CMake will just blow things up
- compilation works but there are LOTS and LOTS of warnings (over 9000), if this is okay nevermind but since most of them are related to deprecated functions either consider fixing or suppressing them
- Release mode is untested - I suppose it won't be a big deal but might need some fixing

More info here: https://groups.google.com/forum/#!topic/skia-discuss/HLu-Hesfbg4

BUG=skia:4269

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1370263004
2015-09-30 11:06:53 -07:00
mtklein
a5b0f0318b cmake tweaks
• -w silences all warnings current and future.  We're not using this for development.
  • There's no real need to exclude files in Release mode.
    The linker may whine a little, but that's fine.
  • Quiet down message() calls that run every time.  They're fine if you can figure out
    how to run them only when doing the detection and cache them like all the others,
    but I don't like the noise seeing them every run.
  • cheaders is hard to read.  c_headers.
  • ../src/*mac* erroneously picks up SkLumaColorFilter on non-case-sensitive file systems.
    ../src/*_mac* seems fine.

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot

BUG=skia:

Review URL: https://codereview.chromium.org/1376923003
2015-09-29 13:16:34 -07:00
halcanary
4ae26258ef CMake: Compile in OSMesa on Linux, if found.
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1353383003
2015-09-21 09:42:23 -07:00
mtklein
de5973b05b small tweaks to cmake_build
- streamline how we define $here
  - only make `cmake` when bootstrapping; it's a little less to build

BUG=skia:4269
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1345663004
2015-09-15 10:17:08 -07:00
mtklein
935121bd41 Let's try building the example app on the bots too.
BUG=skia:4269

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/1344843002
2015-09-15 06:07:47 -07:00
Mike Klein
5d2be0df43 cmake_build is a bash script.
BUG=skia:4269

Review URL: https://codereview.chromium.org/1334203003 .
2015-09-15 08:29:02 -04:00
mtklein
0faed58bc7 cmake_build: support SKIA_OUT and BUILDTYPE
And, fix BUILDTYPE=Debug build.
EQUAL is for numbers, STREQUAL for strings.

BUG=skia:

Review URL: https://codereview.chromium.org/1341763003
2015-09-14 12:02:32 -07:00
mtklein
a22eabedef CMake bot script
- Add CMake v3.3.1 (latest) to DEPS.
 - Add cmake/bot-cmake.sh to bootstrap CMake then build Skia using that.

Works on my Mac and Linux box, both with no system CMake installation.

CMake will be ~100M on disk.  The first bootstrap takes a couple minutes,
and a no-op re-run of bot-cmake.sh takes 15-20 seconds.  I thought about
having bot-cmake.sh fetch CMake instead of DEPS, but I'm not sure I can
handle updates, etc. as robustly as it can.

This will only work on Linux and Mac.  CMake requires an older CMake on
Windows.  It doesn't have an equivalent ./bootstrap there.  Will have to
think about how Windows bots will work!

BUG=skia:4269

Review URL: https://codereview.chromium.org/1339603003
2015-09-14 10:02:50 -07:00
halcanary
5a9a5b3e7f CMAKE + install command
NOTRY=true

Review URL: https://codereview.chromium.org/1325903004
2015-09-03 14:23:18 -07:00
halcanary
2a4a4219aa Cmake: fix to make linking work on Ubuntu
Review URL: https://codereview.chromium.org/1320443009
2015-09-01 10:11:44 -07:00
mtklein
0ce744e306 CMake tweaks
- I think CMake 3.1 is enough for now.
  - Ubuntu works too.

BUG=skia:4269

Review URL: https://codereview.chromium.org/1323093002
2015-09-01 09:22:32 -07:00
mtklein
2409abb812 CMake builds on Ubuntu now too.
Punted for now on GL on Linux.  Man that's a beast.

BUG=skia:4269

Review URL: https://codereview.chromium.org/1315753009
2015-08-31 06:59:21 -07:00
mtklein
e0f06a4752 Example CMake build for Skia.
This works only on Mac, probably only on 64-bit,
and doesn't support SkCodec.

BUG=skia:4269

Review URL: https://codereview.chromium.org/1319543003
2015-08-28 11:51:07 -07:00