aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-09-30 11:06:53 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-30 11:06:53 -0700
commit56c6a117b222aa7d94843cfe6058e085d4394d97 (patch)
treebf0f149eb1d4043e47df5b8a821cb88f87bb9ba9 /cmake
parent3a7701c0101386ba05acdde6f911be0c2696f317 (diff)
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
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CMakeLists.txt34
1 files changed, 29 insertions, 5 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 35e6398106..ab6952f1e4 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -57,10 +57,18 @@ remove_srcs (../src/animator/* ../src/*nacl* ../src/svg/* ../src/views/* ../src/
if (NOT WIN32)
remove_srcs(../src/*XPS*
../src/*_win*.cpp
- ../src/gpu/gl/angle/*
../src/ports/SkImageDecoder_WIC.cpp
../src/utils/win/*)
endif()
+if (NOT UNIX)
+ remove_srcs(../src/doc/SkDocument_XPS_None.cpp
+ ../src/ports/SkDebug_stdio.cpp
+ ../src/ports/SkOSFile_posix.cpp
+ ../src/ports/SkTLS_pthread.cpp
+ ../src/ports/SkTime_Unix.cpp
+ ../src/utils/SkThreadUtils_pthread.cpp
+ ../src/utils/SkThreadUtils_pthread_other.cpp)
+endif()
if (APPLE OR NOT UNIX)
remove_srcs(../src/gpu/gl/glx/*
../src/images/SkImageDecoder_FactoryDefault.cpp
@@ -104,6 +112,15 @@ remove_srcs(
../src/ports/SkImageGenerator_none.cpp
../src/ports/SkTLS_none.cpp)
+if (WIN32)
+ if(SKIA_GDI)
+ remove_srcs(../src/ports/SkFontMgr_win_dw_factory.cpp)
+ else()
+ remove_srcs(../src/ports/SkFontMgr_win_gdi_factory.cpp)
+ endif()
+endif()
+
+remove_srcs(../src/gpu/gl/angle/*) # TODO
remove_srcs(../src/codec/*) # TODO: Requires Chromium's libjpeg-turbo, and incompatible giflib.
# Certain files must be compiled with support for SSSE3 or SSE4.1 intrinsics.
@@ -200,6 +217,10 @@ else()
remove_srcs(../src/gpu/gl/mesa/*)
endif()
+if (WIN32)
+ list (APPEND libs FontSub.lib Usp10.lib)
+endif()
+
find_package(OpenGL REQUIRED)
list (APPEND libs ${OPENGL_LIBRARIES})
@@ -208,11 +229,9 @@ list (APPEND libs ${OPENGL_LIBRARIES})
# not so much that we think Skia is a good candidate to ship as a shared library.
add_library (skia SHARED ${srcs})
-list (APPEND private_defines "-DSKIA_DLL")
-
target_compile_definitions(skia
PUBLIC ${public_defines}
- PRIVATE ${private_defines})
+ PRIVATE -DSKIA_DLL -DSKIA_IMPLEMENTATION=1)
target_include_directories(skia
PUBLIC ${public_includes}
@@ -222,9 +241,14 @@ target_link_libraries(skia
PUBLIC
PRIVATE ${libs})
+if (MSVC)
+ set(cc_flags "/w /GR-")
+else()
+ set(cc_flags "-w -fno-rtti -fno-exceptions")
+endif()
set_target_properties(skia PROPERTIES
- COMPILE_FLAGS "-w -fno-exceptions -fno-rtti"
+ COMPILE_FLAGS ${cc_flags}
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN true)