[buildout]
extends =
    ../xz-utils/buildout.cfg
    ../cmake/buildout.cfg
    ../git/buildout.cfg

parts = llvm

[llvm-cmake]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${:version}/cmake-${:version}.src.tar.xz
version = 15.0.0
md5sum = e2e69ec36e163293f0b558e0382660cb
environment =
  PATH=${xz-utils:location}/bin:%(PATH)s

[llvm]
recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${:version}/llvm-${:version}.src.tar.xz
version = 15.0.0
md5sum = 7b406c97f87b94cda4224aa53968c9d5
pre-configure =
  cp ${llvm-cmake:location}/Modules/* ./cmake/modules/
configure-command = ${cmake:location}/bin/cmake
configure-options =
    -Bbuild
    -DCMAKE_INSTALL_PREFIX=@@LOCATION@@
    -DCMAKE_BUILD_TYPE=Release
    -DLLVM_INSTALL_UTILS=ON
    -DLLVM_INCLUDE_BENCHMARKS=OFF
    -DCMAKE_C_FLAGS="${:CMAKE_CFLAGS}"
    -DCMAKE_CXX_FLAGS="${:CMAKE_CFLAGS}"
make-options = -C build
CMAKE_CFLAGS = -I${libxml2:location}/include/libxml2 -I${ncurses:location}/include -I${zlib:location}/include
environment =
    PATH=${xz-utils:location}/bin:${git:location}/bin:%(PATH)s
    LDFLAGS=-L${libxml2:location}/lib -L${ncurses:location}/lib -L${zlib:location}/lib -Wl,-rpath=${libxml2:location}/lib -Wl,-rpath=${ncurses:location}/lib -Wl,-rpath=${zlib:location}/lib
