PKGNAME=cppdap
PKGSEC=libs
PKGDES="C++ library for the Debug Adapter Protocol"
# NOTE: while building with jsoncpp on Afterglow, it expects a static
# library, which Afterglow does not preserve.
# NOTE: nlohmann-json is header only.
PKGDEP="nlohmann-json"
BUILDDEP="cmake gtest"

CMAKE_AFTER=(
	"-DCPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE=ON"
)

# NOTE: do not build with LTO, when building CMake:
# lto1: fatal error: bytecode stream in file ‘/usr/lib/libcppdap.a’ generated with LTO version 14.0 instead of the expected 15.1
# compilation terminated.
# lto-wrapper: fatal error: /usr/bin/g++ returned 1 exit status
# compilation terminated.
# /usr/bin/ld: error: lto-wrapper failed
# collect2: error: ld returned 1 exit status
NOLTO=1

# NOTE: static library only.
NOSTATIC=0
ABSTRIP=0
ABSPLITDBG=0

# Needed by Afterglow, whereas FAIL_ARCH defaults to mainline-only.
FAIL_ARCH="!(mainline|retro)"
