[]
package=ui
input=*
stormUsingNamespace=storm
stormUsingNamespace+=storm::geometry

#flags+=/d1reportSingleClassLayoutGradientStop

# No includes for the Skia header.
noIncludes+=*/Skia.h

[unix,cairogl]
# Note: We provide our own version of Cairo, since many systems do not provide a cairo
# that has GL support. Our version of cairo is placed next to the Gui library, and the
# rpath is set to $ORIGIN to give our version of Cairo priority over the system's version.
# Specify "cairogl" on the command line to enable this rendering backend.

# Name of the cairo shared library file.
cairoName=libcairo.so.2

# Compile cairo if necessary. We're using build system provided by Cairo.
preBuild+=./build_cairo.sh <path|packagePath><cairoName> <maxThreads>

# Set rpath.
linkFlags+=-Wl,-rpath,'$ORIGIN'

# Make sure to link our version of Cairo first, since that contains all symbols needed.
linkFlags+=<path|packagePath><cairoName>

define+=GUI_ENABLE_CAIRO_GL

[unix,!noskia]
# Skia stuff:
# Compile Skia if necessary.
preBuild+=./build_skia.sh <path|buildDir>skia.a <maxThreads>
# Link Skia.
linkFlags+=<path|buildDir>skia.a
# Include path.
include+=../Linux/skia
# Defines
define+=SK_GL=1

# Need this as well.
linkFlags+=-lharfbuzz

# Tell it to not complain about ABI incompatibilities due to missing CPU features. We build
# Skia with the same flags, so it is OK.
flags+=-Wno-psabi

# Skia now uses [[clang::reinitializes]], which GCC does not support.
flags+=-Wno-attributes

define+=GUI_ENABLE_SKIA

# Note: Cairo needs to be first. Otherwise we link the wrong .so-file for Cairo.
[unix]
# Need C++ 17 for Skia. We always enable it to make things simple.
flags+=-std=c++17

library+=dl

# Defaults
flags+=`pkg-config --cflags gtk+-3.0 x11 fontconfig`
linkFlags+=`pkg-config --libs gtk+-3.0 x11 fontconfig pangoft2` -lGL -lEGL

