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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 list (APPEND libs ${OSMESA_LIBRARIES}) | 241 list (APPEND libs ${OSMESA_LIBRARIES}) |
| 242 list (APPEND private_includes ${OSMESA_INCLUDE_DIRS}) | 242 list (APPEND private_includes ${OSMESA_INCLUDE_DIRS}) |
| 243 list (APPEND public_defines "-DSK_MESA=1") | 243 list (APPEND public_defines "-DSK_MESA=1") |
| 244 set (SK_MESA 1) | 244 set (SK_MESA 1) |
| 245 else() | 245 else() |
| 246 remove_srcs(../src/gpu/gl/mesa/*) | 246 remove_srcs(../src/gpu/gl/mesa/*) |
| 247 endif() | 247 endif() |
| 248 | 248 |
| 249 if (WIN32) | 249 if (WIN32) |
| 250 list (APPEND libs FontSub.lib Usp10.lib) | 250 list (APPEND libs FontSub.lib Usp10.lib) |
| 251 list (APPEND public_defines "-DSK_BUILD_FOR_WIN32") | |
|
Marco A.
2016/03/25 14:10:27
Specifically this is needed when compiling on a Wi
mtklein
2016/03/25 14:15:12
Let's have src/ports/SkOSEnvironment.cpp #include
| |
| 251 endif() | 252 endif() |
| 252 | 253 |
| 253 find_package(OpenGL REQUIRED) | 254 find_package(OpenGL REQUIRED) |
| 254 list (APPEND libs ${OPENGL_LIBRARIES}) | 255 list (APPEND libs ${OPENGL_LIBRARIES}) |
| 255 | 256 |
| 256 # This is our main output, libskia.so. | 257 # This is our main output, libskia.so. |
| 257 # We mostly build an .so here because it helps test we've linked everything, | 258 # We mostly build an .so here because it helps test we've linked everything, |
| 258 # not so much that we think Skia is a good candidate to ship as a shared library . | 259 # not so much that we think Skia is a good candidate to ship as a shared library . |
| 259 add_library (skia SHARED ${srcs}) | 260 add_library (skia SHARED ${srcs}) |
| 260 | 261 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 285 file(GLOB c_headers "../include/c/*.h") | 286 file(GLOB c_headers "../include/c/*.h") |
| 286 install(FILES ${c_headers} DESTINATION include) | 287 install(FILES ${c_headers} DESTINATION include) |
| 287 install(TARGETS skia DESTINATION lib) | 288 install(TARGETS skia DESTINATION lib) |
| 288 | 289 |
| 289 # SkUserConfig.h | 290 # SkUserConfig.h |
| 290 if (CMAKE_BUILD_TYPE STREQUAL Release) | 291 if (CMAKE_BUILD_TYPE STREQUAL Release) |
| 291 set (SK_RELEASE 1) | 292 set (SK_RELEASE 1) |
| 292 else() | 293 else() |
| 293 set (SK_RELEASE 0) | 294 set (SK_RELEASE 0) |
| 294 endif() | 295 endif() |
| 296 if (UNIX AND NOT APPLE) | |
| 297 set (SK_SAMPLES_FOR_X 1) | |
| 298 else() | |
| 299 set (SK_SAMPLES_FOR_X 0) | |
| 300 endif() | |
| 295 configure_file ("SkUserConfig.h.in" "${userconfig_directory}/SkUserConfig.h") | 301 configure_file ("SkUserConfig.h.in" "${userconfig_directory}/SkUserConfig.h") |
| 296 | 302 |
| 297 # skia_link_arguments.txt | 303 # skia_link_arguments.txt |
| 298 set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) | 304 set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) |
| 299 file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") | 305 file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") |
| 300 file (APPEND ${link_arguments} "-lskia\n") | 306 file (APPEND ${link_arguments} "-lskia\n") |
| 301 file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") | 307 file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") |
| 302 | 308 |
| 303 # skia_compile_arguments.txt | 309 # skia_compile_arguments.txt |
| 304 set (compile_arguments ${CMAKE_BINARY_DIR}/skia_compile_arguments.txt) | 310 set (compile_arguments ${CMAKE_BINARY_DIR}/skia_compile_arguments.txt) |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 330 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") | 336 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") |
| 331 endif () | 337 endif () |
| 332 endforeach() | 338 endforeach() |
| 333 endif() | 339 endif() |
| 334 endforeach() | 340 endforeach() |
| 335 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") | 341 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") |
| 336 | 342 |
| 337 # Now build a simple example app that uses Skia via libskia.so. | 343 # Now build a simple example app that uses Skia via libskia.so. |
| 338 add_executable(example example.cpp) | 344 add_executable(example example.cpp) |
| 339 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 345 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
| OLD | NEW |