Skip to content
Snippets Groups Projects
Commit af8a1c0d authored by Filippo Cremonese's avatar Filippo Cremonese
Browse files

Switch clang-release to overlay convention

parent 9149d768
No related branches found
No related tags found
No related merge requests found
#@ load("@ytt:template", "template")
#@ load("@ytt:data", "data")
#@ load("/components/clang_release.lib.yml", "clang_release_component")
#@ load("/components/glib.lib.yml", "glib_component")
#@ load("/components/glibc.lib.yml", "glibc_component")
#@ load("/components/qemu.lib.yml", "qemu_component")
......@@ -45,7 +44,6 @@
#@ load("/global_options.lib.yml", "options")
components:
clang-release: #@ clang_release_component
glib: #@ glib_component
glibc: #@ glibc_component
qemu: #@ qemu_component
......
#@ load("/components/llvm_common.lib.yml", "configure_llvm")
#@ load("/lib/create_component.lib.yml", "single_build_component")
#@ load("/global_options.lib.yml", "options")
---
#@ def cmake_opts():
- -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;libcxxabi;libcxx;clang-tools-extra"
- -DBUILD_SHARED_LIBS=OFF
#@ end
#@yaml/text-templated-strings
---
#@ def _clang_release():
#@ source_url = "https://github.com/llvm/llvm-project/archive/llvmorg-" + options["clang_release_version"] + ".tar.gz"
builds:
default:
configure: |
extract.sh --into "$BUILD_DIR/source" "(@= source_url @)"
sed -i 's|GIT_FOUND|FALSE|g' "$BUILD_DIR/source/llvm/cmake/modules/VersionFromVCS.cmake"
(@= configure_llvm(cmake_build_type="Release", cflags=" ", additional_cmake_options=cmake_opts(), source_dir="$BUILD_DIR/source") @)
install: |
cd "$BUILD_DIR"
ninja install
rm "${DESTDIR}${ORCHESTRA_ROOT}/lib64/libc++.so" || true
echo 'INPUT(libc++.so.1 -lc++abi -lpthread)' > "${DESTDIR}${ORCHESTRA_ROOT}/lib64/libc++.so"
if test -z "$DESTDIR"; then
echo "Installing clang-release which will clobber LLVM!"
else
find ${DESTDIR}${ORCHESTRA_ROOT}/lib* -maxdepth 1 -not -type d \( -name libLLVM* -or -name libclang* \) -delete;
rm ${DESTDIR}${ORCHESTRA_ROOT}/bin/opt || true
rm ${DESTDIR}${ORCHESTRA_ROOT}/bin/llvm-config || true
rm -rf ${DESTDIR}${ORCHESTRA_ROOT}/lib*/cmake/ || true
rm -rf ${DESTDIR}${ORCHESTRA_ROOT}/include/clang/ || true
rm -rf ${DESTDIR}${ORCHESTRA_ROOT}/include/clang-c/ || true
rm -rf ${DESTDIR}${ORCHESTRA_ROOT}/include/llvm/ || true
rm -rf ${DESTDIR}${ORCHESTRA_ROOT}/include/llvm-c/ || true
fi
build_dependencies:
- cmake
dependencies:
- toolchain/host/gcc
- toolchain/host/binutils
- libunwind
#@ end
---
#@ clang_release_component = _clang_release()
#@ load("@ytt:overlay", "overlay")
#@ load("/components/llvm_common.lib.yml", "configure_llvm")
#@ load("/lib/create_component.lib.yml", "single_build_component")
#@ load("/global_options.lib.yml", "options")
---
#@ def cmake_opts():
- -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;libcxxabi;libcxx;clang-tools-extra"
- -DBUILD_SHARED_LIBS=OFF
#@ end
#@yaml/text-templated-strings
---
#@ def _clang_release_args():
#@ source_url = "https://github.com/llvm/llvm-project/archive/llvmorg-" + options["clang_release_version"] + ".tar.gz"
configure: |
extract.sh --into "$BUILD_DIR/source" "(@= source_url @)"
sed -i 's|GIT_FOUND|FALSE|g' "$BUILD_DIR/source/llvm/cmake/modules/VersionFromVCS.cmake"
(@= configure_llvm(cmake_build_type="Release", cflags=" ", additional_cmake_options=cmake_opts(), source_dir="$BUILD_DIR/source") @)
install: |
cd "$BUILD_DIR"
ninja install
rm "${DESTDIR}${ORCHESTRA_ROOT}/lib64/libc++.so" || true
echo 'INPUT(libc++.so.1 -lc++abi -lpthread)' > "${DESTDIR}${ORCHESTRA_ROOT}/lib64/libc++.so"
if test -z "$DESTDIR"; then
echo "Installing clang-release which will clobber LLVM!"
else
find ${DESTDIR}${ORCHESTRA_ROOT}/lib* -maxdepth 1 -not -type d \( -name libLLVM* -or -name libclang* \) -delete;
rm ${DESTDIR}${ORCHESTRA_ROOT}/bin/opt || true
rm ${DESTDIR}${ORCHESTRA_ROOT}/bin/llvm-config || true
rm -rf ${DESTDIR}${ORCHESTRA_ROOT}/lib*/cmake/ || true
rm -rf ${DESTDIR}${ORCHESTRA_ROOT}/include/clang/ || true
rm -rf ${DESTDIR}${ORCHESTRA_ROOT}/include/clang-c/ || true
rm -rf ${DESTDIR}${ORCHESTRA_ROOT}/include/llvm/ || true
rm -rf ${DESTDIR}${ORCHESTRA_ROOT}/include/llvm-c/ || true
fi
build_dependencies:
- cmake
dependencies:
- toolchain/host/gcc
- toolchain/host/binutils
- libunwind
#@ end
#@overlay/match by=overlay.all, expects=1
#@overlay/match-child-defaults missing_ok=True
---
components:
clang-release: #@ single_build_component(**_clang_release_args())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment