-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
69 lines (56 loc) · 2.32 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(SkiaWebBind VERSION 0.2)
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
message(FATAL_ERROR "SkiaWebBind need to be compiled with emscripten to WASM, currently building to ${CMAKE_SYSTEM_NAME}.")
endif()
set(SKIA_WEB_BIND_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SKIA_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/skia")
set(SKIA_WEB_BIND_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
message(${PROJECT_NAME} ": compiler id is " ${CMAKE_CXX_COMPILER_ID} " VERSION IS " ${CMAKE_CXX_COMPILER_VERSION})
# add compile caching if ccache is installed on the system
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set(CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" CACHE INTERNAL "")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
message("Enabled compiler caching")
endif()
#add_compile_options(-fwasm-exceptions)
add_compile_options(-pthread)
add_compile_options(-DSK_FORCE_8_BYTE_ALIGNMENT)
add_compile_options(-DSK_DISABLE_LEGACY_PARAGRAPH_UNICODE=1)
add_compile_options(-DSK_RELEASE)
add_compile_options(-DSK_GL)
add_compile_options(-DCK_ENABLE_WEBGL)
add_compile_options(-DNDEBUG)
add_compile_options(-DSK_TRIVIAL_ABI=[[clang::trivial_abi]])
add_compile_options(-DSK_FONTMGR_FREETYPE_EMBEDDED_AVAILABLE)
add_compile_options(-DSK_TYPEFACE_FACTORY_FREETYPE)
add_compile_options(-DSK_ENABLE_PRECOMPILE)
add_compile_options(-DSKNX_NO_SIMD)
add_compile_options(-DSK_DISABLE_TRACING)
add_compile_options(-DSK_DISABLE_EFFECT_DESERIALIZATION)
add_compile_options(-DCANVASKIT_NO_ALIAS_FONT)
add_compile_options(-DSK_ASSUME_WEBGL=1)
add_compile_options(-DSWB_ENABLE_WEBGL=1)
add_compile_options(-fno-exceptions)
add_compile_options(-Wno-attributes)
add_compile_options(-ffp-contract=off)
add_compile_options(-fstrict-aliasing)
add_compile_options(-fPIC)
add_compile_options(-fvisibility=hidden)
add_compile_options(-std=c++26)
add_compile_options(-fvisibility-inlines-hidden)
add_compile_options(-fdebug-compilation-dir=${CMAKE_CURRENT_SOURCE_DIR})
add_compile_options(-fno-rtti)
add_library(SkiaWebBind STATIC
"src/swbWebSurface.cpp")
target_include_directories(SkiaWebBind
PUBLIC
include
${SKIA_ROOT_DIR}
)
add_subdirectory(example)