Skip to content

Commit d16743c

Browse files
committed
Update docker.md
Update setup-cpp to v0.36.2 Upgrade to gcovr v6.0 Use newest cmake and project_options
1 parent 4cca74d commit d16743c

File tree

10 files changed

+30
-50
lines changed

10 files changed

+30
-50
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN apt-get update -qq && \
55
# install nodejs
66
apt-get install -y --no-install-recommends nodejs npm && \
77
# install setup-cpp
8-
npm install -g setup-cpp@v0.35.1 && \
8+
npm install -g setup-cpp@v0.36.2 && \
99
# install the compiler and tools
1010
setup-cpp \
1111
--nala true \
@@ -28,4 +28,8 @@ RUN apt-get update -qq && \
2828
rm -rf /var/lib/apt/lists/* && \
2929
rm -rf /tmp/*
3030

31+
# Include project
32+
ADD . /workspaces/cpp_vcpkg_project
33+
WORKDIR /workspaces/cpp_vcpkg_project
34+
3135
ENTRYPOINT ["/bin/bash"]

.devcontainer/run.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
matrix:
3131
os:
3232
- ubuntu-22.04
33-
- macos-11
33+
- macos-13
3434
- windows-2022
3535
compiler:
3636
# you can specify the version after `-` like "llvm-13.0.0".
@@ -51,9 +51,9 @@ jobs:
5151

5252
# Only to test non-multiconfig builds
5353
- os: ubuntu-22.04
54-
compiler: gcc-11
55-
CMAKE_GENERATOR: "Unix Makefiles"
56-
GCOV: gcov-11
54+
compiler: gcc
55+
CMAKE_GENERATOR: "Ninja"
56+
GCOV: gcov
5757

5858
- os: windows-2022
5959
compiler: msvc
@@ -95,10 +95,8 @@ jobs:
9595
ccache: true
9696
clangtidy: true
9797
task: true
98-
9998
cppcheck: true
100-
101-
gcovr: "5.2"
99+
gcovr: true
102100
opencppcoverage: true
103101

104102
- name: Initialize CodeQL

.gitlab-ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ stages:
1313
echo -e "\e[0Ksection_start:`date +%s`:my_setup_linux[collapsed=true]\r\e[0KHeader of the setup linux collapsible section"
1414
DEBIAN_FRONTEND=noninteractive
1515

16-
# XXX WHY? set time-zone
17-
# TZ=Canada/Pacific
18-
# ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
16+
# set time-zone
17+
TZ=Canada/Pacific
18+
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
1919

2020
# for downloading
2121
apt-get update -qq
@@ -24,8 +24,9 @@ stages:
2424

2525
.setup_cpp: &setup_cpp |
2626
echo -e "\e[0Ksection_start:`date +%s`:my_setup_cpp[collapsed=true]\r\e[0KHeader of the setup cpp collapsible section"
27-
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.33.0/setup-cpp-x64-linux"
27+
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.35.3/setup-cpp-x64-linux"
2828
chmod +x setup-cpp-x64-linux
29+
# export PATH="$HOME/.local/bin:$PATH"
2930
./setup-cpp-x64-linux --compiler $compiler --ccache true --vcpkg true --clangtidy true
3031
source ~/.cpprc
3132
pwd && mkdir -p build/coverage
@@ -35,6 +36,7 @@ stages:
3536
python3 -m pip install cmake ninja gcovr
3637
cmake --version
3738
ninja --version
39+
which gcovr && gcovr --version
3840

3941
# XXX not longer used! CK
4042
.task: &test |
@@ -52,7 +54,7 @@ stages:
5254
- echo -e "\e[0Ksection_end:`date +%s`:my_build\r\e[0K"
5355

5456
default: # Add a default section to define the `image` keyword's default value
55-
image: ubuntu:22.04
57+
image: ubuntu:latest
5658
before_script:
5759
- *setup_linux
5860

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.21...3.27)
1+
cmake_minimum_required(VERSION 3.21...3.28)
22

33
# set a default CXX standard for the tools and targets that do not specify them.
44
# If commented, the latest supported standard for your compiler is automatically set.
@@ -14,7 +14,7 @@ endif()
1414

1515
# Add project_options from https://github.com/aminya/project_options
1616
# Change the version in the following URL to update the package (watch the releases of the repository for future updates)
17-
set(PROJECT_OPTIONS_VERSION "v0.33.1")
17+
set(PROJECT_OPTIONS_VERSION "v0.34.0")
1818
FetchContent_Declare(
1919
_project_options
2020
GIT_SUBMODULES ""

CMakePresets.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
"minor": 25,
66
"patch": 0
77
},
8-
"include": [
9-
"CMakeWorkflowPresets.json"
10-
],
118
"configurePresets": [
129
{
1310
"name": "conf-common",

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
# - list all the task under PHONY
55
# - If getting missing separator error, try replacing spaces with tabs.
66
# - If using Visual Studio, either run the following commands inside the Visual Studio command prompt (vcvarsall) or remove the Ninja generator from the commands.
7-
.PHONY: build test test_release docs format clean
7+
.PHONY: build test test_release test_install docs format clean
88

9-
build:
10-
make release
9+
build: release
1110

1211
release:
1312
cmake -S ./ -B ./build -G "Ninja Multi-Config" -DCMAKE_BUILD_TYPE:STRING=Release -DFEATURE_TESTS:BOOL=OFF
@@ -41,15 +40,15 @@ test_release:
4140
(cd build/my_header_lib/test && ctest -C Release --output-on-failure)
4241
(cd build/my_lib/test && ctest -C Release --output-on-failure)
4342

44-
test_install:
45-
cmake --install ./build --prefix ./build/test_install
43+
test_install: release
44+
cmake --install ./build --prefix ./build/install
4645

4746
coverage:
4847
ifeq ($(OS), Windows_NT)
4948
OpenCppCoverage.exe --export_type cobertura:coverage.xml --cover_children -- make test
5049
else
5150
make test
52-
gcovr -j 1 --delete --root ./ --print-summary --xml-pretty --xml coverage.xml ./build --gcov-executable gcov
51+
gcovr -j 1 --delete --root ./ --print-summary --xml-pretty --xml coverage.xml ./build --gcov-executable gcov-13
5352
endif
5453

5554
docs:
@@ -68,4 +67,4 @@ ifeq ($(OS), Windows_NT)
6867
pwsh -c 'function rmrf($$path) { if (test-path $$path) { rm -r -force $$path }}; rmrf ./build;'
6968
else
7069
rm -rf ./build
71-
endif
70+
endif

build/coverage/.keep

Whitespace-only changes.

docs/building.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CMake will detect which compiler was used to build each of the Conan targets. If
2424

2525
- Temporarily (only for the current shell)
2626

27-
Run one of the followings in the terminal:
27+
Run one of the following in the terminal:
2828

2929
- clang
3030

@@ -51,7 +51,7 @@ CMake will detect which compiler was used to build each of the Conan targets. If
5151

5252
- Permanent:
5353

54-
Run one of the followings in PowerShell:
54+
Run one of the following in PowerShell:
5555

5656
- Visual Studio generator and compiler (cl)
5757

@@ -92,7 +92,7 @@ With Cmake directly:
9292

9393
cmake -S . -B ./build
9494

95-
Cmake will automatically create the `./build` folder if it does not exist, and it wil configure the project.
95+
Cmake will automatically create the `./build` folder if it does not exist, and it configures the project.
9696

9797
Instead, if you have CMake version 3.21+, you can use one of the configuration presets that are listed in the CmakePresets.json file.
9898

docs/docker.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,9 @@ docker run -it devcontainer:latest
1010

1111
This command will put you in a `bash` session in a Ubuntu 22.04 Docker container,
1212
with all of the tools listed in the [Dependencies](#dependencies) section already installed.
13-
Additionally, you will have `g++-13` and `clang++-13` installed as the default
13+
Additionally, you will have `g++-13` and `clang++-16` installed as the default
1414
versions of `g++` and `clang++`.
1515

16-
If you want to build this container using some other versions of gcc and clang,
17-
you may do so with the `GCC_VER` and `LLVM_VER` arguments:
18-
19-
```bash
20-
docker build --tag=myproject:latest --build-arg GCC_VER=10 --build-arg LLVM_VER=15 .
21-
```
22-
23-
The CC and CXX environment variables are set to GCC version 13 by default.
24-
If you wish to use clang as your default CC and CXX environment variables, you
25-
may do so like this:
26-
27-
```bash
28-
docker build --tag=devcontainer:latest --build-arg USE_CLANG=1 .
29-
```
30-
3116
You will be logged in as root, so you will see the `#` symbol as your prompt.
3217
You will be in a directory that contains a copy of the `cpp_vcpkg_project`;
3318
any changes you make to your local copy will not be updated in the Docker image
@@ -46,11 +31,10 @@ You can configure and build [as directed above](#build) using these commands:
4631

4732
```bash
4833
/cpp_vcpkg_project# cmake --workflow --preset gcc-debug
49-
/cpp_vcpkg_project# mkdir -p build/coverage
5034
/cpp_vcpkg_project# gcovr
5135
```
5236

53-
You can configure and build using `clang-15`, without rebuilding the container,
37+
You can configure and build using `clang-16`, without rebuilding the container,
5438
with these commands:
5539

5640
```bash

0 commit comments

Comments
 (0)