# dev-libs/opencl-clang-16.0.0.ebuild
EAPI=8
inherit cmake

DESCRIPTION="OpenCL-oriented wrapper library around Clang (libOpenCLClang)"
HOMEPAGE="https://github.com/intel/opencl-clang"
SRC_URI="https://github.com/intel/opencl-clang/archive/refs/tags/v${PV}.tar.gz -> opencl-clang-${PV}.tar.gz"
LICENSE="NCSA"  # LLVM NCSA license
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

DEPEND=">=sys-devel/llvm-${PV}:16[clang]"
RDEPEND="${DEPEND}"

S="${WORKDIR}/opencl-clang-${PV}"

src_configure() {
    local mycmakeargs=(
        -DLLVM_DIR="/usr/lib/llvm-16/lib/cmake/llvm"  # adjust to the correct LLVM cmake path
    )
    cmake_src_configure
}

src_install() {
    default
    dodoc README.md LICENSE
}
