SUMMARY="Efficient and performance-portable SIMD"
DESCRIPTION="Highway is a C++ library for SIMD (Single Instruction, Multiple \
Data), i.e. applying the same operation to 'lanes'.

Why Highway?

- more portable (same source code) than platform-specific intrinsics,
- works on a wider range of compilers than compiler-specific vector extensions,
- more dependable than autovectorization,
- easier to write/maintain than assembly language,
- supports **runtime dispatch**,
- supports **variable-length vector** architectures."
HOMEPAGE="https://github.com/google/highway"
COPYRIGHT="2020 Google LLC"
LICENSE="Apache v2"
REVISION="1"
SOURCE_URI="https://github.com/google/highway/archive/refs/tags/$portVersion.tar.gz"
CHECKSUM_SHA256="e1d47ce510429fdcf31f41697ca74fb0dcd59d933196e531a86d51751a56f4cc"
SOURCE_FILENAME="highway-$portVersion.tar.gz"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	highway$secondaryArchSuffix = $portVersion
	devel:libhwy$secondaryArchSuffix = $portVersion
	devel:libhwy_contrib$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:gcc$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	cmake -B build -S . \
		$cmakeDirArgs \
		-DBUILD_TESTING=OFF
	make -C build $jobArgs
}

INSTALL()
{
	make -C build install

	prepareInstalledDevelLibs \
		libhwy libhwy_contrib
	fixPkgconfig

	# cleanup
	rmdir $libDir
}
