| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 else() | 116 else() |
| 117 remove_srcs(../src/ports/SkFontMgr_win_gdi_factory.cpp) | 117 remove_srcs(../src/ports/SkFontMgr_win_gdi_factory.cpp) |
| 118 endif() | 118 endif() |
| 119 endif() | 119 endif() |
| 120 | 120 |
| 121 # Certain files must be compiled with support for SSSE3, SSE4.1, AVX, or AVX2 in
trinsics. | 121 # Certain files must be compiled with support for SSSE3, SSE4.1, AVX, or AVX2 in
trinsics. |
| 122 file (GLOB_RECURSE ssse3_srcs ../src/*ssse3*.cpp ../src/*SSSE3*.cpp) | 122 file (GLOB_RECURSE ssse3_srcs ../src/*ssse3*.cpp ../src/*SSSE3*.cpp) |
| 123 file (GLOB_RECURSE sse41_srcs ../src/*sse4*.cpp ../src/*SSE4*.cpp) | 123 file (GLOB_RECURSE sse41_srcs ../src/*sse4*.cpp ../src/*SSE4*.cpp) |
| 124 file (GLOB_RECURSE avx_srcs ../src/*_avx.cpp) | 124 file (GLOB_RECURSE avx_srcs ../src/*_avx.cpp) |
| 125 file (GLOB_RECURSE avx2_srcs ../src/*_avx2.cpp) | 125 file (GLOB_RECURSE avx2_srcs ../src/*_avx2.cpp) |
| 126 set_source_files_properties(${ssse3_srcs} PROPERTIES COMPILE_FLAGS -mssse3) | 126 if (NOT WIN32) |
| 127 set_source_files_properties(${sse41_srcs} PROPERTIES COMPILE_FLAGS -msse4.1) | 127 set_source_files_properties(${ssse3_srcs} PROPERTIES COMPILE_FLAGS -mssse3) |
| 128 set_source_files_properties(${avx_srcs} PROPERTIES COMPILE_FLAGS -mavx) | 128 set_source_files_properties(${sse41_srcs} PROPERTIES COMPILE_FLAGS -msse4.1) |
| 129 set_source_files_properties(${avx2_srcs} PROPERTIES COMPILE_FLAGS -mavx2) | 129 set_source_files_properties(${avx_srcs} PROPERTIES COMPILE_FLAGS -mavx) |
| 130 set_source_files_properties(${avx2_srcs} PROPERTIES COMPILE_FLAGS -mavx2) |
| 131 endif() |
| 130 | 132 |
| 131 # Detect our optional dependencies. | 133 # Detect our optional dependencies. |
| 132 # If we can't find them, don't build the parts of Skia that use them. | 134 # If we can't find them, don't build the parts of Skia that use them. |
| 133 find_package (EXPAT) | 135 find_package (EXPAT) |
| 134 find_package (Lua) | 136 find_package (Lua) |
| 135 find_package (ZLIB) | 137 find_package (ZLIB) |
| 136 # No find_package for libwebp as far as I can tell, so simulate it here. | 138 # No find_package for libwebp as far as I can tell, so simulate it here. |
| 137 find_path (WEBP_INCLUDE_DIRS "webp/decode.h") | 139 find_path (WEBP_INCLUDE_DIRS "webp/decode.h") |
| 138 find_library (WEBP_LIBRARIES webp) | 140 find_library (WEBP_LIBRARIES webp) |
| 139 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h") | 141 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h") |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 260 |
| 259 target_include_directories(skia | 261 target_include_directories(skia |
| 260 PUBLIC ${public_includes} | 262 PUBLIC ${public_includes} |
| 261 PRIVATE ${private_includes}) | 263 PRIVATE ${private_includes}) |
| 262 | 264 |
| 263 target_link_libraries(skia | 265 target_link_libraries(skia |
| 264 PUBLIC | 266 PUBLIC |
| 265 PRIVATE ${libs}) | 267 PRIVATE ${libs}) |
| 266 | 268 |
| 267 if (MSVC) | 269 if (MSVC) |
| 270 string(REGEX REPLACE " /W3 " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") |
| 268 set(cc_flags "/w /GR-") | 271 set(cc_flags "/w /GR-") |
| 269 else() | 272 else() |
| 270 set(cc_flags "-w -fno-rtti -fno-exceptions") | 273 set(cc_flags "-w -fno-rtti -fno-exceptions") |
| 271 endif() | 274 endif() |
| 272 | 275 |
| 273 set_target_properties(skia PROPERTIES | 276 set_target_properties(skia PROPERTIES |
| 274 COMPILE_FLAGS ${cc_flags} | 277 COMPILE_FLAGS ${cc_flags} |
| 275 CXX_VISIBILITY_PRESET hidden | 278 CXX_VISIBILITY_PRESET hidden |
| 276 VISIBILITY_INLINES_HIDDEN true) | 279 VISIBILITY_INLINES_HIDDEN true) |
| 277 | 280 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") | 332 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") |
| 330 endif () | 333 endif () |
| 331 endforeach() | 334 endforeach() |
| 332 endif() | 335 endif() |
| 333 endforeach() | 336 endforeach() |
| 334 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") | 337 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") |
| 335 | 338 |
| 336 # Now build a simple example app that uses Skia via libskia.so. | 339 # Now build a simple example app that uses Skia via libskia.so. |
| 337 add_executable(example example.cpp) | 340 add_executable(example example.cpp) |
| 338 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 341 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
| OLD | NEW |