diff options
author | mtklein <mtklein@chromium.org> | 2015-11-02 10:20:27 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-02 10:20:27 -0800 |
commit | 1ee76510f5dbf632d30975fc3509ef4f609156d2 (patch) | |
tree | a2d6b772ec69a735bd37ebdbdc6864cfe823a7cc /cmake | |
parent | 3f0424ff57f93666df7347d4787816b210233eb0 (diff) |
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
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/CMakeLists.txt | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 348b72475a..c6614f3fec 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -52,16 +52,8 @@ remove_srcs (../src/ports/SkFontMgr_custom*.cpp) remove_srcs (../src/animator/* ../src/*nacl* ../src/svg/* ../src/views/* ../src/xml/*) # Remove OS-specific source files. -if (NOT WIN32) - remove_srcs(../src/*XPS* - ../src/*_win*.cpp - ../src/ports/SkImageDecoder_WIC.cpp - ../src/utils/win/*) -endif() if (NOT UNIX) - remove_srcs(../src/doc/SkDocument_XPS_None.cpp - ../src/ports/*_posix.cpp - ../src/ports/SkDebug_stdio.cpp + remove_srcs(../src/ports/*_posix.cpp ../src/ports/SkTLS_pthread.cpp ../src/ports/SkTime_Unix.cpp ../src/utils/SkThreadUtils_pthread.cpp) @@ -72,15 +64,6 @@ if (APPLE OR NOT UNIX) ../src/ports/SkFontMgr_fontconfig*.cpp ../src/*FreeType*) endif() -if (NOT ANDROID) - remove_srcs(../src/*Hwui* ../src/*android*) -endif() -if (NOT APPLE) - remove_srcs(../src/*darwin* - ../src/ports/SkImageDecoder_CG.cpp - ../src/utils/mac/* - ../src/*_mac*) -endif() # Remove processor-specific source files. if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ARM) @@ -128,6 +111,7 @@ set_source_files_properties(${sse41_srcs} PROPERTIES COMPILE_FLAGS -msse4.1) # Detect our optional dependencies. # If we can't find them, don't build the parts of Skia that use them. +find_package (EXPAT) find_package (Lua) find_package (ZLIB) # No find_package for libwebp as far as I can tell, so simulate it here. @@ -148,6 +132,13 @@ endif() # TODO: macro away this if (found) ... else() ... endif() stuff. +if (EXPAT_FOUND) + list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) + list (APPEND libs ${EXPAT_LIBRARIES}) +else() + remove_srcs (../src/ports/SkFontMgr_android_parser.cpp) +endif() + if (GIF_FOUND) list (APPEND private_includes ${GIF_INCLUDE_DIRS}) list (APPEND libs ${GIF_LIBRARIES}) |