Start making all .cpp files compile-able on all platforms.
authormtklein <mtklein@chromium.org>
Mon, 2 Nov 2015 18:20:27 +0000 (10:20 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 2 Nov 2015 18:20:27 +0000 (10:20 -0800)
commit1ee76510f5dbf632d30975fc3509ef4f609156d2
treea2d6b772ec69a735bd37ebdbdc6864cfe823a7cc
parent3f0424ff57f93666df7347d4787816b210233eb0
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
40 files changed:
cmake/CMakeLists.txt
src/device/xps/SkXPSDevice.cpp
src/doc/SkDocument_XPS.cpp
src/doc/SkDocument_XPS_None.cpp
src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
src/ports/SkDebug_android.cpp
src/ports/SkDebug_nacl.cpp [deleted file]
src/ports/SkDebug_stdio.cpp
src/ports/SkDebug_win.cpp
src/ports/SkFontHost_mac.cpp
src/ports/SkFontHost_win.cpp
src/ports/SkFontMgr_android.cpp
src/ports/SkFontMgr_android_factory.cpp
src/ports/SkFontMgr_android_parser.cpp
src/ports/SkFontMgr_win_dw.cpp
src/ports/SkFontMgr_win_dw_factory.cpp
src/ports/SkFontMgr_win_gdi_factory.cpp
src/ports/SkImageDecoder_CG.cpp
src/ports/SkImageDecoder_WIC.cpp
src/ports/SkOSFile_win.cpp
src/ports/SkOSLibrary_posix.cpp
src/ports/SkOSLibrary_win.cpp
src/ports/SkRemotableFontMgr_win_dw.cpp
src/ports/SkScalerContext_win_dw.cpp
src/ports/SkTLS_win.cpp
src/ports/SkTime_win.cpp
src/ports/SkTypeface_win_dw.cpp
src/utils/SkThreadUtils_win.cpp
src/utils/mac/SkCreateCGImageRef.cpp
src/utils/mac/SkStream_mac.cpp
src/utils/win/SkAutoCoInitialize.cpp
src/utils/win/SkDWrite.cpp
src/utils/win/SkDWriteFontFileStream.cpp
src/utils/win/SkDWriteGeometrySink.cpp
src/utils/win/SkHRESULT.cpp
src/utils/win/SkIStream.cpp
src/utils/win/SkWGL_win.cpp