Initial commit

parents
image: docker:latest
services:
- docker:dind
variables:
CONTAINER_TAGGED_IMAGE: registry.gitlab.com/bueddl/docker-clang:$CI_BUILD_REF_NAME
CONTAINER_RELEASE_IMAGE: registry.gitlab.com/bueddl/docker-clang:latest
stages:
- build-tools
- build-image
- release
before_script:
- docker info
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
build-clang:
stage: build-tools
image: debian:sid-slim
before_script:
- apt update -y && apt install -y cmake g++ make git python libedit-dev swig python-dev
- git clone https://github.com/llvm/llvm-project.git
- mkdir llvm-project/build
- cd llvm-project/build
script:
- cmake -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;libunwind;lldb;clang-tools-extra;lld;compiler-rt" -DLIBUNWIND_USE_COMPILER_RT=ON -DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_USE_COMPILER_RT=ON -DCMAKE_BUILD_TYPE=Release -DCLANG_DEFAULT_LINKER=lld -DCLANG_DEFAULT_RTLIB=compiler-rt -DCLANG_DEFAULT_STDLIB=libc++ -G "Unix Makefiles" ../llvm
- make -j$(nproc)
- make DESTDIR=../../rootfs install
artifacts:
paths:
- rootfs
expire_in: 1 week
build-cmake:
stage: build-tools
image: debian:sid-slim
before_script:
- apt update -y && apt install -y cmake g++ make git python
- git clone https://gitlab.kitware.com/cmake/cmake.git
- mkdir cmake/build
- cd cmake/build
script:
- cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ..
- make -j$(nproc)
- make DESTDIR=../../rootfs install
artifacts:
paths:
- rootfs
expire_in: 1 week
build-image:
stage: build-image
dependencies:
- build-clang
- build-cmake
script:
- find .
- docker build -t $CONTAINER_TAGGED_IMAGE .
- docker push $CONTAINER_TAGGED_IMAGE
release:
stage: release
script:
- docker pull $CONTAINER_TAGGED_IMAGE
- docker tag $CONTAINER_TAGGED_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
only:
- master
FROM debian:sid-slim
RUN apt update -y && apt install -y git make libc-dev
RUN ln -sf /usr/local/bin/lld /usr/local/bin/ld
RUN ln -sf /usr/local/bin/llvm-ar /usr/local/bin/ar
RUN ln -sf /usr/local/bin/llvm-as /usr/local/bin/as
ADD rootfs /
# Docker: llvm/clang/cmake
A docker image containing a full featured C++ LLVM toolchain.
## Using this container image
In order to compile your project using this container, you have to set two environment variables to instruct cmake to properly integrate into the LLVM toolchain.
You can do this in the `variables` section in your `.gitlab-ci.yml` for example:
```yaml
variables:
CXXFLAGS: --stdlib=libc++
LINKFLAGS: --rtlib=compiler-rt
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment