Chromium Code Reviews| 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 if (UNIX AND NOT APPLE AND EXISTS "/usr/include/GL/osmesa.h") | |
| 202 set(SK_MESA 1) | |
| 203 list (APPEND libs "OSMesa") | |
| 204 else() | |
| 205 remove_srcs(../src/gpu/gl/mesa/*) | |
| 206 endif() | |
| 207 | |
| 202 # This is our main output, libskia.so. | 208 # This is our main output, libskia.so. |
| 203 # We mostly build an .so here because it helps test we've linked everything, | 209 # 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 . | 210 # not so much that we think Skia is a good candidate to ship as a shared library . |
| 205 add_library (skia SHARED ${srcs}) | 211 add_library (skia SHARED ${srcs}) |
| 206 | 212 |
| 207 target_compile_definitions(skia | 213 target_compile_definitions(skia |
| 208 PUBLIC | 214 PUBLIC |
| 209 PRIVATE -DSKIA_DLL) | 215 PRIVATE -DSKIA_DLL) |
| 210 | 216 |
| 217 if (SK_MESA) | |
| 218 target_compile_definitions(skia | |
|
mtklein
2015/09/21 15:51:56
Even if this works, I'd prefer it if you switch th
| |
| 219 PUBLIC -DSK_MESA | |
| 220 PRIVATE -DSK_MESA) | |
| 221 endif() | |
| 222 | |
| 211 target_include_directories(skia | 223 target_include_directories(skia |
| 212 PUBLIC ${public_includes} | 224 PUBLIC ${public_includes} |
| 213 PRIVATE ${private_includes}) | 225 PRIVATE ${private_includes}) |
| 214 | 226 |
| 215 target_link_libraries(skia | 227 target_link_libraries(skia |
| 216 PUBLIC | 228 PUBLIC |
| 217 PRIVATE ${libs}) | 229 PRIVATE ${libs}) |
| 218 | 230 |
| 219 | 231 |
| 220 set_target_properties(skia PROPERTIES | 232 set_target_properties(skia PROPERTIES |
| 221 COMPILE_FLAGS "-fno-exceptions -fno-rtti -Wno-deprecated-declarations" | 233 COMPILE_FLAGS "-fno-exceptions -fno-rtti -Wno-deprecated-declarations" |
| 222 CXX_VISIBILITY_PRESET hidden | 234 CXX_VISIBILITY_PRESET hidden |
| 223 VISIBILITY_INLINES_HIDDEN true) | 235 VISIBILITY_INLINES_HIDDEN true) |
| 224 | 236 |
| 225 # Experimental C API install: | 237 # Experimental C API install: |
| 226 file(GLOB cheaders "../include/c/*.h") | 238 file(GLOB cheaders "../include/c/*.h") |
| 227 install(FILES ${cheaders} DESTINATION include) | 239 install(FILES ${cheaders} DESTINATION include) |
| 228 install(TARGETS skia DESTINATION lib) | 240 install(TARGETS skia DESTINATION lib) |
| 229 | 241 |
| 230 # Now build a simple example app that uses Skia via libskia.so. | 242 # Now build a simple example app that uses Skia via libskia.so. |
| 231 add_executable(example example.cpp) | 243 add_executable(example example.cpp) |
| 232 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 244 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
| OLD | NEW |