Skip to content

Example about building Skia C++ programs with Swift Package Manager

Notifications You must be signed in to change notification settings

swiftfn/SPM_SkiaSDLExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Example about building Skia C++ programs with Swift Package Manager

See:

See also:

Build Skia

See:

Build static libraries:

bin/gn gen out/mac --args="is_debug=false is_official_build=true \
skia_use_system_expat=false skia_use_system_libjpeg_turbo=false \
skia_use_system_libpng=false skia_use_system_libwebp=false \
skia_use_system_zlib=false skia_use_system_icu=false \
skia_use_system_harfbuzz=false"

ninja -C out/mac

Build this example

Create symlinks to the built Skia above (include, out/mac, and src directories are used):

cd Sources/cpp
ln -s /path/to/skia skia

Build:

swift build
swift build -c release

Run:

swift run cpp
.build/debug/cpp
.build/release/cpp

Equivalent build command with gcc:

export SKIA_SRC=/path/to/skia

gcc main.cpp \
-std=c++14 -lstdc++ \
`pkg-config --cflags --libs SDL2` \
-I${SKIA_SRC} -L${SKIA_SRC}/out/mac -lskia \
-framework CoreFoundation -framework CoreGraphics \
-framework CoreText -framework CoreServices \
-framework OpenGL

About

Example about building Skia C++ programs with Swift Package Manager

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published