Skip to content

Commit

Permalink
Merge pull request #72 from ksromanov/workaround_for_clang_llvm_14
Browse files Browse the repository at this point in the history
Request support for C language in top-level CMakeLists.txt
  • Loading branch information
dbeer1 authored Sep 2, 2022
2 parents 4b1f915 + 6b3a05e commit 5a7f5c2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ matrix:
language: cpp
sudo: true
script: docker build --build-arg TARGET_LLVM_VERSION=13 .
- os: linux
dist: jammy
compiler: gcc
language: cpp
sudo: true
script: docker build --build-arg TARGET_LLVM_VERSION=14 --build-arg BASE_IMAGE=ubuntu:22.04 --build-arg GCC_VERSION=9 --build-arg IMAGE_REPO=jammy .
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.6)

project(clangmetatool CXX)
project(clangmetatool C CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM $BASE_IMAGE

ARG TARGET_LLVM_VERSION=8
ARG IMAGE_REPO=bionic
ARG GCC_VERSION=7

# Depenedencies to fetch, build llvm and clang
RUN apt-get update && apt-get install -y \
Expand All @@ -20,8 +21,8 @@ RUN apt-get update

RUN apt-get install -y \
# Build toolchains that we are targeting for compatibility with
gcc-7 \
g++-7 \
gcc-"$GCC_VERSION" \
g++-"$GCC_VERSION" \
cmake \
# clangmetatool uses gtest
libgtest-dev \
Expand All @@ -42,16 +43,16 @@ RUN apt-get install -y \
libc++-"$TARGET_LLVM_VERSION"-dev

# Set up build environment
ENV CC=/usr/bin/gcc-7 \
CXX=/usr/bin/g++-7 \
ENV CC=/usr/bin/gcc-"$GCC_VERSION" \
CXX=/usr/bin/g++-"$GCC_VERSION" \
MAKEFLAGS="-j4" \
CMAKE_BUILD_PARALLEL_LEVEL=4

# Install gtest as they recommend to, for 1.8.x
RUN cd /usr/src/gtest && \
cmake . && \
make && \
mv libg* /usr/lib
find . -name "libg*" -exec mv {} /usr/lib \;

COPY . clangmetatool/
WORKDIR clangmetatool
Expand Down
4 changes: 2 additions & 2 deletions t/029-tool-application-support.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ TEST_F(ToolApplicationSupportTest, ARCH_DEPENDENT(GCCToolChain))
ASSERT_DEATH(
verifyInstallation({"tool", "test.cpp", "--",
"-resource-dir", CLANG_RESOURCE_DIR,
"-gcc-toolchain", "/non-existent/123"}),
"--gcc-toolchain=/non-existent/123"}),
messageRegex);
}

Expand All @@ -116,7 +116,7 @@ TEST_F(ToolApplicationSupportTest, ARCH_DEPENDENT(CFilesWithGCCToolChain))
ASSERT_DEATH(
verifyInstallation({"tool", "test.c", "--",
"-resource-dir", CLANG_RESOURCE_DIR,
"-gcc-toolchain", "/non-existent/123"}),
"--gcc-toolchain=/non-existent/123"}),
messageRegex);
}

Expand Down

0 comments on commit 5a7f5c2

Please sign in to comment.