From 57dc18616255b1a59b9ee911b87314cc8719861e Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Mon, 21 Mar 2022 19:00:58 +0100 Subject: [PATCH] chore: clang-12 and clang-format-15 added to gitpod --- .gitpod.Dockerfile | 12 ++++++++++++ .gitpod.yml | 30 +++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .gitpod.Dockerfile diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 00000000..d944277b --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,12 @@ +FROM trainiteu/gitpod-cpp + +# Add clang-12 and clang-15 apt repositories +RUN lsb_rel=`lsb_release -cs` \ + && sudo add-apt-repository "deb http://apt.llvm.org/${lsb_rel}/ llvm-toolchain-${lsb_rel}-12 main" \ + && sudo add-apt-repository "deb http://apt.llvm.org/${lsb_rel}/ llvm-toolchain-${lsb_rel} main" + +# Install older compilers supported by the project as well as clang-format-15 for code formatting +RUN sudo install-packages \ + g++-10 \ + clang-12 \ + clang-format-15 diff --git a/.gitpod.yml b/.gitpod.yml index f11f191f..2263f36d 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,5 @@ -image: trainiteu/gitpod-cpp +image: + file: .gitpod.Dockerfile # -------------------------------------------------------- # exposing ports for VSCode Live Server @@ -52,6 +53,15 @@ tasks: "-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake" ], "cmake.generator": "Ninja Multi-Config", + "[cpp]": { + "editor.defaultFormatter": "ms-vscode.cpptools" + }, + "C_Cpp.clang_format_path": "/usr/bin/clang-format-15", + "editor.formatOnPaste": true, + "editor.formatOnSave": true, + "editor.formatOnType": true, + "editor.bracketPairColorization.enabled": true, + "editor.guides.bracketPairs": "active", "restructuredtext.preview.scrollEditorWithPreview": false, "restructuredtext.preview.scrollPreviewWithEditor": false, "liveServer.settings.root": "/build/docs/docs/sphinx/" @@ -70,11 +80,17 @@ tasks: pushd /workspace/.conan/profiles cp default gcc10 cp default gcc11 + cp default clang12 cp default clang13 popd conan profile update settings.compiler.version=10 gcc10 conan profile update env.CXX=/usr/bin/g++-10 gcc10 conan profile update env.CC=/usr/bin/gcc-10 gcc10 + conan profile update settings.compiler=clang clang12 + conan profile update settings.compiler.version=12 clang12 + conan profile update settings.compiler.libcxx=libstdc++11 clang12 + conan profile update env.CXX=/usr/bin/clang++-12 clang12 + conan profile update env.CC=/usr/bin/clang-12 clang12 conan profile update settings.compiler=clang clang13 conan profile update settings.compiler.version=13 clang13 conan profile update settings.compiler.libcxx=libc++ clang13 @@ -107,6 +123,18 @@ tasks: ctest -C Release ctest -C Debug echo "🛠️ gcc-11 pre-build done! You can close this terminal and use 'Build' button in the VSCode status bar for incremental builds. 🛠️" + - name: clang-12 + init: | + gp sync-await conan-init + mkdir -p build/Clang-12 && cd build/Clang-12 + conan install ../.. -pr clang12 -e mp-units:CONAN_RUN_TESTS=True -o build_docs=False -b outdated + conan install ../.. -pr clang12 -e mp-units:CONAN_RUN_TESTS=True -o build_docs=False -b outdated -s build_type=Debug + cmake ../.. --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DCMAKE_C_COMPILER=/bin/clang-12 -DCMAKE_CXX_COMPILER=/bin/clang++-12 + cmake --build . --config Release -j + cmake --build . --config Debug -j + ctest -C Release + ctest -C Debug + echo "🛠️ clang-12 pre-build done! You can close this terminal and use 'Build' button in the VSCode status bar for incremental builds. 🛠️" - name: clang-13 init: | gp sync-await conan-init