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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 # Make our ports choices. | 93 # Make our ports choices. |
94 remove_srcs( | 94 remove_srcs( |
95 ../src/*moz* # We're probably not Mozilla. | 95 ../src/*moz* # We're probably not Mozilla. |
96 ../src/gpu/GrContextFactory.cpp # For internal testing only . | 96 ../src/gpu/GrContextFactory.cpp # For internal testing only . |
97 ../src/gpu/gl/GrGLCreateNativeInterface_none.cpp | 97 ../src/gpu/gl/GrGLCreateNativeInterface_none.cpp |
98 ../src/gpu/gl/GrGLDefaultInterface_none.cpp | 98 ../src/gpu/gl/GrGLDefaultInterface_none.cpp |
99 ../src/gpu/gl/SkCreatePlatformGLContext*.cpp # For internal testing only . | 99 ../src/gpu/gl/SkCreatePlatformGLContext*.cpp # For internal testing only . |
100 ../src/gpu/gl/command_buffer/* | 100 ../src/gpu/gl/command_buffer/* |
101 ../src/gpu/gl/egl/* | 101 ../src/gpu/gl/egl/* |
102 ../src/gpu/gl/iOS/* | 102 ../src/gpu/gl/iOS/* |
103 ../src/gpu/gl/mesa/* | |
104 ../src/opts/SkBitmapProcState_opts_none.cpp | 103 ../src/opts/SkBitmapProcState_opts_none.cpp |
105 ../src/opts/SkBlitMask_opts_none.cpp | 104 ../src/opts/SkBlitMask_opts_none.cpp |
106 ../src/opts/SkBlitRow_opts_none.cpp | 105 ../src/opts/SkBlitRow_opts_none.cpp |
107 ../src/ports/SkFontMgr_empty_factory.cpp | 106 ../src/ports/SkFontMgr_empty_factory.cpp |
108 ../src/ports/SkGlobalInitialization_chromium.cpp | 107 ../src/ports/SkGlobalInitialization_chromium.cpp |
109 ../src/ports/SkImageDecoder_empty.cpp | 108 ../src/ports/SkImageDecoder_empty.cpp |
110 ../src/ports/SkImageGenerator_none.cpp | 109 ../src/ports/SkImageGenerator_none.cpp |
111 ../src/ports/SkTLS_none.cpp) | 110 ../src/ports/SkTLS_none.cpp) |
112 | 111 |
113 remove_srcs(../src/codec/*) # TODO: Requires Chromium's libjpeg-turbo, and inco mpatible giflib. | 112 remove_srcs(../src/codec/*) # TODO: Requires Chromium's libjpeg-turbo, and inco mpatible giflib. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
192 endif() | 191 endif() |
193 | 192 |
194 if (APPLE) | 193 if (APPLE) |
195 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED) | 194 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED) |
196 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK}) | 195 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK}) |
197 endif() | 196 endif() |
198 | 197 |
199 find_package(OpenGL REQUIRED) | 198 find_package(OpenGL REQUIRED) |
200 list (APPEND libs ${OPENGL_LIBRARIES}) | 199 list (APPEND libs ${OPENGL_LIBRARIES}) |
201 | 200 |
201 list (APPEND private_defines "-DSKIA_DLL") | |
mtklein_C
2015/09/21 16:14:39
As a nit, let's move this out of where all the dep
hal.canary
2015/09/21 16:35:57
Done.
| |
202 | |
203 find_library(OSMESA_LIBRARIES "OSMesa") | |
mtklein_C
2015/09/21 16:14:39
Let's put the find_* together with the others abov
hal.canary
2015/09/21 16:35:57
Done.
| |
204 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h") | |
205 if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS) | |
206 list (APPEND libs ${OSMESA_LIBRARIES}) | |
mtklein_C
2015/09/21 16:14:39
Add OSMESA_INCLUDE_DIRS to private_includes?
hal.canary
2015/09/21 16:35:57
It was just /usr/include; but no harm. done.
| |
207 list (APPEND public_defines "-DSK_MESA=1") | |
208 message("-- Found OSMesa: " ${OSMESA_LIBRARIES}) | |
mtklein_C
2015/09/21 16:14:39
Remove this. It'll print anyway
| |
209 else() | |
210 remove_srcs(../src/gpu/gl/mesa/*) | |
211 endif() | |
212 | |
202 # This is our main output, libskia.so. | 213 # This is our main output, libskia.so. |
203 # We mostly build an .so here because it helps test we've linked everything, | 214 # We mostly build an .so here because it helps test we've linked everything, |
204 # not so much that we think Skia is a good candidate to ship as a shared library . | 215 # not so much that we think Skia is a good candidate to ship as a shared library . |
205 add_library (skia SHARED ${srcs}) | 216 add_library (skia SHARED ${srcs}) |
206 | 217 |
207 target_compile_definitions(skia | 218 target_compile_definitions(skia |
208 PUBLIC | 219 PUBLIC ${public_defines} |
209 PRIVATE -DSKIA_DLL) | 220 PRIVATE ${private_defines}) |
210 | 221 |
211 target_include_directories(skia | 222 target_include_directories(skia |
212 PUBLIC ${public_includes} | 223 PUBLIC ${public_includes} |
213 PRIVATE ${private_includes}) | 224 PRIVATE ${private_includes}) |
214 | 225 |
215 target_link_libraries(skia | 226 target_link_libraries(skia |
216 PUBLIC | 227 PUBLIC |
217 PRIVATE ${libs}) | 228 PRIVATE ${libs}) |
218 | 229 |
219 | 230 |
220 set_target_properties(skia PROPERTIES | 231 set_target_properties(skia PROPERTIES |
221 COMPILE_FLAGS "-fno-exceptions -fno-rtti -Wno-deprecated-declarations" | 232 COMPILE_FLAGS "-fno-exceptions -fno-rtti -Wno-deprecated-declarations" |
222 CXX_VISIBILITY_PRESET hidden | 233 CXX_VISIBILITY_PRESET hidden |
223 VISIBILITY_INLINES_HIDDEN true) | 234 VISIBILITY_INLINES_HIDDEN true) |
224 | 235 |
225 # Experimental C API install: | 236 # Experimental C API install: |
226 file(GLOB cheaders "../include/c/*.h") | 237 file(GLOB cheaders "../include/c/*.h") |
227 install(FILES ${cheaders} DESTINATION include) | 238 install(FILES ${cheaders} DESTINATION include) |
228 install(TARGETS skia DESTINATION lib) | 239 install(TARGETS skia DESTINATION lib) |
229 | 240 |
230 # Now build a simple example app that uses Skia via libskia.so. | 241 # Now build a simple example app that uses Skia via libskia.so. |
231 add_executable(example example.cpp) | 242 add_executable(example example.cpp) |
232 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 243 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
OLD | NEW |