From 73e16bd7973fb360c4bc176b82211f75f8ef070e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20H=C3=B6lscher?= Date: Fri, 15 Jul 2022 09:10:44 +0200 Subject: [PATCH] Added VS Code devcontainer and uptaded needed llvm versionn to 14. --- .devcontainer/Dockerfile | 12 ++++++++++++ .devcontainer/devcontainer.json | 30 ++++++++++++++++++++++++++++++ CMakeLists.txt | 4 ++-- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..8639e18 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,12 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/ubuntu/.devcontainer/base.Dockerfile + +# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04 +ARG VARIANT="jammy" +FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} + +# [Optional] Uncomment this section to install additional OS packages. +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends \ + llvm llvm-dev clang lldb gcc gdb cmake make ninja-build + +ENV LLVM_DIR=/usr/lib/llvm-14 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..306cf83 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,30 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/ubuntu +{ + "name": "Ubuntu", + "build": { + "dockerfile": "Dockerfile", + // Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04 + // Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon. + "args": { "VARIANT": "ubuntu-22.04" } + }, + "extensions": ["llvm-vs-code-extensions.vscode-clangd", + "matepek.vscode-catch2-test-adapter", + "twxs.cmake", + "vadimcn.vscode-lldb", + "xaver.clang-format" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "uname -a", + + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode", + "features": { + "git": "latest", + "fish": "latest" + } +} diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e6c2cc..08e8564 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,10 +59,10 @@ endif() # `find_package(llvm)`. So there's no need to add it here. list(APPEND CMAKE_PREFIX_PATH "${LT_LLVM_INSTALL_DIR}/lib/cmake/llvm/") -find_package(LLVM 13.0.0 REQUIRED CONFIG) +find_package(LLVM 14.0.0 REQUIRED CONFIG) # Another sanity check -if(NOT "13" VERSION_EQUAL "${LLVM_VERSION_MAJOR}") +if(NOT "14" VERSION_EQUAL "${LLVM_VERSION_MAJOR}") message(FATAL_ERROR "Found LLVM ${LLVM_VERSION_MAJOR}, but need LLVM 13") endif()