OLD | NEW |
1 # Boilerplate. | 1 # Boilerplate. |
2 cmake_minimum_required (VERSION 3.1) # First version with CMAKE_CXX_STANDARD. | 2 cmake_minimum_required (VERSION 3.1) # First version with CMAKE_CXX_STANDARD. |
3 project (skimake) | 3 project (skimake) |
4 set (CMAKE_CXX_STANDARD 11) | 4 set (CMAKE_CXX_STANDARD 11) |
5 | 5 |
6 # Default to Release mode. We're mainly targeting Skia users, not Skia develope
rs. | 6 # Default to Release mode. We're mainly targeting Skia users, not Skia develope
rs. |
7 if (NOT CMAKE_BUILD_TYPE) | 7 if (NOT CMAKE_BUILD_TYPE) |
8 set (CMAKE_BUILD_TYPE Release) | 8 set (CMAKE_BUILD_TYPE Release) |
9 endif () | 9 endif () |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 # Not actually used by Skia. | 50 # Not actually used by Skia. |
51 remove_srcs (../src/utils/SkThreadUtils_pthread_*.cpp) | 51 remove_srcs (../src/utils/SkThreadUtils_pthread_*.cpp) |
52 | 52 |
53 # Skia sure ships a lot of code no one uses. | 53 # Skia sure ships a lot of code no one uses. |
54 remove_srcs (../src/animator/* ../src/*nacl* ../src/svg/* ../src/views/* ../src/
xml/*) | 54 remove_srcs (../src/animator/* ../src/*nacl* ../src/svg/* ../src/views/* ../src/
xml/*) |
55 | 55 |
56 # Remove OS-specific source files. | 56 # Remove OS-specific source files. |
57 if (NOT WIN32) | 57 if (NOT WIN32) |
58 remove_srcs(../src/*XPS* | 58 remove_srcs(../src/*XPS* |
59 ../src/*_win*.cpp | 59 ../src/*_win*.cpp |
60 ../src/gpu/gl/angle/* | |
61 ../src/ports/SkImageDecoder_WIC.cpp | 60 ../src/ports/SkImageDecoder_WIC.cpp |
62 ../src/utils/win/*) | 61 ../src/utils/win/*) |
63 endif() | 62 endif() |
| 63 if (NOT UNIX) |
| 64 remove_srcs(../src/doc/SkDocument_XPS_None.cpp |
| 65 ../src/ports/SkDebug_stdio.cpp |
| 66 ../src/ports/SkOSFile_posix.cpp |
| 67 ../src/ports/SkTLS_pthread.cpp |
| 68 ../src/ports/SkTime_Unix.cpp |
| 69 ../src/utils/SkThreadUtils_pthread.cpp |
| 70 ../src/utils/SkThreadUtils_pthread_other.cpp) |
| 71 endif() |
64 if (APPLE OR NOT UNIX) | 72 if (APPLE OR NOT UNIX) |
65 remove_srcs(../src/gpu/gl/glx/* | 73 remove_srcs(../src/gpu/gl/glx/* |
66 ../src/images/SkImageDecoder_FactoryDefault.cpp | 74 ../src/images/SkImageDecoder_FactoryDefault.cpp |
67 ../src/ports/SkFontMgr_fontconfig*.cpp | 75 ../src/ports/SkFontMgr_fontconfig*.cpp |
68 ../src/*FreeType*) | 76 ../src/*FreeType*) |
69 endif() | 77 endif() |
70 if (NOT ANDROID) | 78 if (NOT ANDROID) |
71 remove_srcs(../src/*Hwui* ../src/*android*) | 79 remove_srcs(../src/*Hwui* ../src/*android*) |
72 endif() | 80 endif() |
73 if (NOT APPLE) | 81 if (NOT APPLE) |
(...skipping 23 matching lines...) Expand all Loading... |
97 ../src/gpu/gl/iOS/* | 105 ../src/gpu/gl/iOS/* |
98 ../src/opts/SkBitmapProcState_opts_none.cpp | 106 ../src/opts/SkBitmapProcState_opts_none.cpp |
99 ../src/opts/SkBlitMask_opts_none.cpp | 107 ../src/opts/SkBlitMask_opts_none.cpp |
100 ../src/opts/SkBlitRow_opts_none.cpp | 108 ../src/opts/SkBlitRow_opts_none.cpp |
101 ../src/ports/SkFontMgr_empty_factory.cpp | 109 ../src/ports/SkFontMgr_empty_factory.cpp |
102 ../src/ports/SkGlobalInitialization_chromium.cpp | 110 ../src/ports/SkGlobalInitialization_chromium.cpp |
103 ../src/ports/SkImageDecoder_empty.cpp | 111 ../src/ports/SkImageDecoder_empty.cpp |
104 ../src/ports/SkImageGenerator_none.cpp | 112 ../src/ports/SkImageGenerator_none.cpp |
105 ../src/ports/SkTLS_none.cpp) | 113 ../src/ports/SkTLS_none.cpp) |
106 | 114 |
| 115 if (WIN32) |
| 116 if(SKIA_GDI) |
| 117 remove_srcs(../src/ports/SkFontMgr_win_dw_factory.cpp) |
| 118 else() |
| 119 remove_srcs(../src/ports/SkFontMgr_win_gdi_factory.cpp) |
| 120 endif() |
| 121 endif() |
| 122 |
| 123 remove_srcs(../src/gpu/gl/angle/*) # TODO |
107 remove_srcs(../src/codec/*) # TODO: Requires Chromium's libjpeg-turbo, and inco
mpatible giflib. | 124 remove_srcs(../src/codec/*) # TODO: Requires Chromium's libjpeg-turbo, and inco
mpatible giflib. |
108 | 125 |
109 # Certain files must be compiled with support for SSSE3 or SSE4.1 intrinsics. | 126 # Certain files must be compiled with support for SSSE3 or SSE4.1 intrinsics. |
110 file (GLOB_RECURSE ssse3_srcs ../src/*ssse3*.cpp ../src/*SSSE3*.cpp) | 127 file (GLOB_RECURSE ssse3_srcs ../src/*ssse3*.cpp ../src/*SSSE3*.cpp) |
111 file (GLOB_RECURSE sse41_srcs ../src/*sse4*.cpp ../src/*SSE4*.cpp) | 128 file (GLOB_RECURSE sse41_srcs ../src/*sse4*.cpp ../src/*SSE4*.cpp) |
112 set_source_files_properties(${ssse3_srcs} PROPERTIES COMPILE_FLAGS -mssse3) | 129 set_source_files_properties(${ssse3_srcs} PROPERTIES COMPILE_FLAGS -mssse3) |
113 set_source_files_properties(${sse41_srcs} PROPERTIES COMPILE_FLAGS -msse4.1) | 130 set_source_files_properties(${sse41_srcs} PROPERTIES COMPILE_FLAGS -msse4.1) |
114 | 131 |
115 # Detect our optional dependencies. | 132 # Detect our optional dependencies. |
116 # If we can't find them, don't build the parts of Skia that use them. | 133 # If we can't find them, don't build the parts of Skia that use them. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 endif() | 210 endif() |
194 | 211 |
195 if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS) | 212 if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS) |
196 list (APPEND libs ${OSMESA_LIBRARIES}) | 213 list (APPEND libs ${OSMESA_LIBRARIES}) |
197 list (APPEND private_includes ${OSMESA_INCLUDE_DIRS}) | 214 list (APPEND private_includes ${OSMESA_INCLUDE_DIRS}) |
198 list (APPEND public_defines "-DSK_MESA=1") | 215 list (APPEND public_defines "-DSK_MESA=1") |
199 else() | 216 else() |
200 remove_srcs(../src/gpu/gl/mesa/*) | 217 remove_srcs(../src/gpu/gl/mesa/*) |
201 endif() | 218 endif() |
202 | 219 |
| 220 if (WIN32) |
| 221 list (APPEND libs FontSub.lib Usp10.lib) |
| 222 endif() |
| 223 |
203 find_package(OpenGL REQUIRED) | 224 find_package(OpenGL REQUIRED) |
204 list (APPEND libs ${OPENGL_LIBRARIES}) | 225 list (APPEND libs ${OPENGL_LIBRARIES}) |
205 | 226 |
206 # This is our main output, libskia.so. | 227 # This is our main output, libskia.so. |
207 # We mostly build an .so here because it helps test we've linked everything, | 228 # We mostly build an .so here because it helps test we've linked everything, |
208 # not so much that we think Skia is a good candidate to ship as a shared library
. | 229 # not so much that we think Skia is a good candidate to ship as a shared library
. |
209 add_library (skia SHARED ${srcs}) | 230 add_library (skia SHARED ${srcs}) |
210 | 231 |
211 list (APPEND private_defines "-DSKIA_DLL") | |
212 | |
213 target_compile_definitions(skia | 232 target_compile_definitions(skia |
214 PUBLIC ${public_defines} | 233 PUBLIC ${public_defines} |
215 PRIVATE ${private_defines}) | 234 PRIVATE -DSKIA_DLL -DSKIA_IMPLEMENTATION=1) |
216 | 235 |
217 target_include_directories(skia | 236 target_include_directories(skia |
218 PUBLIC ${public_includes} | 237 PUBLIC ${public_includes} |
219 PRIVATE ${private_includes}) | 238 PRIVATE ${private_includes}) |
220 | 239 |
221 target_link_libraries(skia | 240 target_link_libraries(skia |
222 PUBLIC | 241 PUBLIC |
223 PRIVATE ${libs}) | 242 PRIVATE ${libs}) |
224 | 243 |
| 244 if (MSVC) |
| 245 set(cc_flags "/w /GR-") |
| 246 else() |
| 247 set(cc_flags "-w -fno-rtti -fno-exceptions") |
| 248 endif() |
225 | 249 |
226 set_target_properties(skia PROPERTIES | 250 set_target_properties(skia PROPERTIES |
227 COMPILE_FLAGS "-w -fno-exceptions -fno-rtti" | 251 COMPILE_FLAGS ${cc_flags} |
228 CXX_VISIBILITY_PRESET hidden | 252 CXX_VISIBILITY_PRESET hidden |
229 VISIBILITY_INLINES_HIDDEN true) | 253 VISIBILITY_INLINES_HIDDEN true) |
230 | 254 |
231 # Experimental C API install: | 255 # Experimental C API install: |
232 file(GLOB c_headers "../include/c/*.h") | 256 file(GLOB c_headers "../include/c/*.h") |
233 install(FILES ${c_headers} DESTINATION include) | 257 install(FILES ${c_headers} DESTINATION include) |
234 install(TARGETS skia DESTINATION lib) | 258 install(TARGETS skia DESTINATION lib) |
235 | 259 |
236 # Now build a simple example app that uses Skia via libskia.so. | 260 # Now build a simple example app that uses Skia via libskia.so. |
237 add_executable(example example.cpp) | 261 add_executable(example example.cpp) |
238 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 262 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
OLD | NEW |