Skip to content

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
abeimler committed Oct 18, 2022
2 parents 326c1c8 + 07d40bd commit bb0f42a
Show file tree
Hide file tree
Showing 25 changed files with 236 additions and 68 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ENV CMAKE_ARGS ""
WORKDIR /home/project
COPY ./scripts/docker-build.sh ./docker-build.sh
COPY ./scripts/docker-test.sh ./docker-test.sh
COPY ./scripts/docker-test-coverage.sh ./docker-test-coverage.sh

# install vcpkg
ENV VCPKG_DISABLE_METRICS 1
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.android-21 → Dockerfile.android-v
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ARG processor="x86_64"

ARG vcpkg_target_triplet="arm-android"
ARG android_abi="armeabi-v7a"
ARG android_target="30"

ARG cmake="android-${android_abi}-cmake"
ARG cmake_generator="Ninja"
Expand All @@ -32,7 +33,7 @@ RUN pacman-db-upgrade && \
pacman -Scc --noconfirm
RUN runuser -l yay -c \
"yay -Syu --noconfirm && yay -S --noconfirm \
jdk-openjdk android-platform-21 android-sdk-build-tools-21 \
jdk-openjdk android-platform-${android_target} android-sdk-build-tools-${android_target} \
android-pkg-config android-cmake android-environment" && \
runuser -l yay -c "yay -Scc --noconfirm" && \
rm -rf /home/yay/.cache/*
Expand Down
15 changes: 14 additions & 1 deletion Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ ARG extra_libraries
# Install packages available from standard repos
RUN apt-get update -y && \
apt-get install --no-install-recommends -y \
git ${extra_libraries} && \
git ${extra_libraries} \
curl gnupg coreutils && \
apt-get clean && rm -rf /var/lib/apt/lists/*


Expand All @@ -79,11 +80,23 @@ ENV BUILD_TYPE "Release"
ENV CMAKE_GENERATOR "Ninja"
ENV CMAKE_ARGS ""

# install CodeCov
WORKDIR /home/codecov
RUN curl -Os https://uploader.codecov.io/latest/linux/codecov
RUN curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
RUN curl -Os https://uploader.codecov.io/latest/alpine/codecov
RUN curl -Os https://uploader.codecov.io/latest/alpine/codecov.SHA256SUM
RUN curl -Os https://uploader.codecov.io/latest/alpine/codecov.SHA256SUM.sig
RUN gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
RUN shasum -a 256 -c codecov.SHA256SUM
RUN chmod +x codecov
ENV CODECOV "/home/codecov/codecov"

# setup project env
WORKDIR /home/project
COPY ./scripts/docker-build.sh ./docker-build.sh
COPY ./scripts/docker-test.sh ./docker-test.sh
COPY ./scripts/docker-test-coverage.sh ./docker-test-coverage.sh

# install vcpkg
ENV VCPKG_DISABLE_METRICS 1
Expand Down
24 changes: 21 additions & 3 deletions Dockerfile.ci-setup-cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,31 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F
# Install basic packages available from standard repos
RUN apt-get update -y -qq && \
apt-get install --no-install-recommends -yq \
wget curl pkg-config zip unzip tar git && \
wget curl pkg-config zip unzip tar git \
gnupg coreutils && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# install CodeCov
WORKDIR /home/codecov
RUN curl -Os https://uploader.codecov.io/latest/linux/codecov
RUN curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
RUN curl -Os https://uploader.codecov.io/latest/alpine/codecov
RUN curl -Os https://uploader.codecov.io/latest/alpine/codecov.SHA256SUM
RUN curl -Os https://uploader.codecov.io/latest/alpine/codecov.SHA256SUM.sig
RUN gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
RUN shasum -a 256 -c codecov.SHA256SUM
RUN chmod +x codecov
ENV CODECOV "/home/codecov/codecov"

# download setup_cpp
ARG setup_cpp_linux_version="0.20.1"
ARG setup_cpp_linux_download_url="https://github.com/aminya/setup-cpp/releases/download/v${setup_cpp_linux_version}/setup_cpp_linux"
# add setup_cpp
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.18.0/setup_cpp_linux" -O /setup_cpp_linux
RUN wget --no-verbose ${setup_cpp_linux_download_url} -O /setup_cpp_linux
RUN chmod +x /setup_cpp_linux
RUN /setup_cpp_linux --compiler llvm --gcc true --make true --cmake true --ninja true --ccache true --doxygen true --gcovr true --cppcheck true --clangtidy true --clangformat true

RUN rm -rf /tmp/*
RUN cp /root/.cpprc /root/.bashrc

# Install more tools from standard repos
RUN apt-get update -y && \
Expand Down Expand Up @@ -106,6 +123,7 @@ ENV PROJECT_DIR /home/project
WORKDIR /home/project
COPY ./scripts/docker-build.setup-cpp.sh ./docker-build.sh
COPY ./scripts/docker-test.setup-cpp.sh ./docker-test.sh
COPY ./scripts/docker-test-coverage.sh ./docker-test-coverage.sh
RUN mkdir build

ENV SETUP_ENV_SCRIPT ~/.cpprc
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ENV TOOLCHAIN_FILE "$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
WORKDIR /home/project
COPY ./scripts/docker-build.sh ./docker-build.sh
COPY ./scripts/docker-test.sh ./docker-test.sh
COPY ./scripts/docker-test-coverage.sh ./docker-test-coverage.sh


# build script settings
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.without-vcpkg
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ ENV CMAKE_ARGS ""
WORKDIR /home/project
COPY ./scripts/docker-build-without-toolchain.sh ./docker-build.sh
COPY ./scripts/docker-test.sh ./docker-test.sh
COPY ./scripts/docker-test-coverage.sh ./docker-test-coverage.sh

RUN mkdir build
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0
1.5.0
12 changes: 8 additions & 4 deletions build-images.android-21.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
#!/bin/bash

docker build --force-rm=true -f ./Dockerfile.android-21 \
docker build --force-rm=true -f ./Dockerfile.android-v \
--build-arg vcpkg_target_triplet="arm-android" \
--build-arg cmake="android-armv7a-eabi-cmake" \
--build-arg android_abi="armeabi-v7a" \
--build-arg android_target="21" \
-t abeimler/simple-cppbuilder:arm-android-21 .

docker build --force-rm=true -f ./Dockerfile.android-21 \
docker build --force-rm=true -f ./Dockerfile.android-v \
--build-arg vcpkg_target_triplet="arm64-android" \
--build-arg cmake="android-aarch64-cmake" \
--build-arg android_abi="arm64-v8a" \
--build-arg android_target="21" \
-t abeimler/simple-cppbuilder:arm64-android21 .

docker build --force-rm=true -f ./Dockerfile.android-21 \
docker build --force-rm=true -f ./Dockerfile.android-v \
--build-arg vcpkg_target_triplet="x86-android" \
--build-arg cmake="android-x86-cmake" \
--build-arg android_abi="x86" \
--build-arg android_target="21" \
-t abeimler/simple-cppbuilder:x86-android-21 .

docker build --force-rm=true -f ./Dockerfile.android-21 \
docker build --force-rm=true -f ./Dockerfile.android-v \
--build-arg vcpkg_target_triplet="x64-android" \
--build-arg cmake="android-x86-64-cmake" \
--build-arg android_abi="x86_64" \
--build-arg android_target="21" \
-t abeimler/simple-cppbuilder:x64-android-21 .
29 changes: 29 additions & 0 deletions build-images.android-24.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

docker build --force-rm=true -f ./Dockerfile.android-v \
--build-arg vcpkg_target_triplet="arm-android" \
--build-arg cmake="android-armv7a-eabi-cmake" \
--build-arg android_abi="armeabi-v7a" \
--build-arg android_target="24" \
-t abeimler/simple-cppbuilder:arm-android-24 .

docker build --force-rm=true -f ./Dockerfile.android-v \
--build-arg vcpkg_target_triplet="arm64-android" \
--build-arg cmake="android-aarch64-cmake" \
--build-arg android_abi="arm64-v8a" \
--build-arg android_target="24" \
-t abeimler/simple-cppbuilder:arm64-android24 .

docker build --force-rm=true -f ./Dockerfile.android-v \
--build-arg vcpkg_target_triplet="x86-android" \
--build-arg cmake="android-x86-cmake" \
--build-arg android_abi="x86" \
--build-arg android_target="24" \
-t abeimler/simple-cppbuilder:x86-android-24 .

docker build --force-rm=true -f ./Dockerfile.android-v \
--build-arg vcpkg_target_triplet="x64-android" \
--build-arg cmake="android-x86-64-cmake" \
--build-arg android_abi="x86_64" \
--build-arg android_target="24" \
-t abeimler/simple-cppbuilder:x64-android-24 .
4 changes: 2 additions & 2 deletions build-images.arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ docker build --force-rm=true -f ./Dockerfile.cross \
--build-arg cmake="cmake" \
--build-arg cross_make="ninja" \
--build-arg cross_cmake="cmake" \
--build-arg cmake_toolchain_file="/home/cmake/aarch64-toolchain.cmake" \
--build-arg cmake_toolchain_file="/home/cmake/aarch64.toolchain.cmake" \
-t abeimler/simple-cppbuilder:aarch64-linux .


Expand All @@ -21,5 +21,5 @@ docker build --force-rm=true -f ./Dockerfile.cross \
# --build-arg cmake_generator="Ninja" \
# --build-arg make="ninja" \
# --build-arg cmake="cmake" \
# --build-arg cmake_toolchain_file="/home/cmake/arm-toolchain.cmake" \
# --build-arg cmake_toolchain_file="/home/cmake/arm.toolchain.cmake" \
# -t abeimler/simple-cppbuilder:arm-linux-gnueabihf .
1 change: 1 addition & 0 deletions build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
docker build --force-rm=true -f ./Dockerfile.base -t abeimler/simple-cppbuilder:base .

docker build --force-rm=true -t abeimler/simple-cppbuilder .
#docker build --force-rm=true -t abeimler/simple-cppbuilder:1.5.0 .

docker build --force-rm=true -f ./Dockerfile.without-vcpkg -t abeimler/simple-cppbuilder:without-vcpkg .

Expand Down
2 changes: 1 addition & 1 deletion examples/cpp_starter_project/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ services:
TARGET: all
BUILD_TYPE: Debug
CMAKE_GENERATOR: Ninja
CMAKE_ARGS: -DENABLE_COVERAGE:BOOL=TRUE
CMAKE_ARGS: -DENABLE_COVERAGE:BOOL=ON
# clang Release with different libs
cpp_starter_project-fltk-clang-release-build:
build:
Expand Down
2 changes: 1 addition & 1 deletion examples/example-ci/cmake/CPM.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CPM_DOWNLOAD_VERSION 0.35.1)
set(CPM_DOWNLOAD_VERSION 0.36.0)

if(CPM_SOURCE_CACHE)
# Expand relative path. This is important if the provided path contains a tilde (~)
Expand Down
4 changes: 2 additions & 2 deletions examples/example-ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
environment:
TARGET: all
BUILD_TYPE: RelWithDebInfo
CMAKE_ARGS: -DENABLE_TESTING:BOOL=ON -DENABLE_DEVELOPER_MODE:BOOL=OFF
CMAKE_ARGS: -DENABLE_TESTING:BOOL=ON -DENABLE_DEVELOPER_MODE:BOOL=ON
# example with test coverage
example-gcc-test-cov:
build:
Expand All @@ -29,7 +29,7 @@ services:
environment:
TARGET: all
BUILD_TYPE: Debug
CMAKE_ARGS: -DENABLE_TESTING:BOOL=ON -DOPT_ENABLE_COVERAGE:BOOL=ON -DENABLE_DEVELOPER_MODE:BOOL=OFF
CMAKE_ARGS: -DENABLE_TESTING:BOOL=ON -DOPT_ENABLE_COVERAGE:BOOL=ON -DENABLE_DEVELOPER_MODE:BOOL=ON
# mingw
example-windows-build:
build:
Expand Down
1 change: 1 addition & 0 deletions examples/example/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ build/*
!.vscode/launch.json
!.vscode/extensions.json
.gitignore
.dockerignore
Dockerfile
docker-compose.yml
docker-compose.*.yml
Expand Down
36 changes: 24 additions & 12 deletions examples/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set(OPT_WARNINGS_AS_ERRORS OFF)
include(FetchContent)
# Add project_options
# https://github.com/cpp-best-practices/project_options
FetchContent_Declare(_project_options URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.24.0.zip)
FetchContent_Declare(_project_options URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.25.2.zip)
FetchContent_MakeAvailable(_project_options)
include(${_project_options_SOURCE_DIR}/Index.cmake)

Expand Down Expand Up @@ -80,25 +80,38 @@ set(ENABLE_CPPCHECK OFF)
set(ENABLE_SANITIZER_ADDRESS OFF)
set(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR OFF)
set(ENABLE_COVERAGE OFF)
set(ENABLE_INCLUDE_WHAT_YOU_USE OFF)
set(ENABLE_INTERPROCEDURAL_OPTIMIZATION OFF)

option(ENABLE_CHECKING "Enable Static analyzer" OFF)
option(ENABLE_CHECKING_INCLUDE_WHAT_YOU_USE "Enable Static analyzer for include-what-you-use" OFF)
if(ENABLE_CHECKING)
set(ENABLE_CLANG_TIDY "ENABLE_CLANG_TIDY")
set(ENABLE_CPPCHECK "ENABLE_CPPCHECK")
set(ENABLE_INCLUDE_WHAT_YOU_USE "ENABLE_INCLUDE_WHAT_YOU_USE")
endif()
if(ENABLE_CHECKING_INCLUDE_WHAT_YOU_USE)
set(ENABLE_INCLUDE_WHAT_YOU_USE "ENABLE_INCLUDE_WHAT_YOU_USE")
endif()

option(ENABLE_TESTING "Enable the tests" ${PROJECT_IS_TOP_LEVEL})
option(DISABLE_SANITIZER "Disable Sanitizer" OFF)
if(ENABLE_TESTING)
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
set(ENABLE_SANITIZER_ADDRESS "ENABLE_SANITIZER_ADDRESS")
set(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR "ENABLE_SANITIZER_UNDEFINED_BEHAVIOR")
else()
# FIXME: Catch2d.lib(catch_istream.cpp.obj) : error LNK2038: mismatch detected for 'annotate_vector': value '0' doesn't match value '1'
# # or it is MSVC and has run vcvarsall
# string(FIND "$ENV{PATH}" "$ENV{VSINSTALLDIR}" index_of_vs_install_dir)
# if(MSVC AND "${index_of_vs_install_dir}" STREQUAL "-1")
# set(ENABLE_SANITIZER_ADDRESS "ENABLE_SANITIZER_ADDRESS")
# endif()
if(NOT DEFINED OPT_ENABLE_COVERAGE)
set(ENABLE_COVERAGE "ENABLE_COVERAGE")
endif()

if(NOT DISABLE_SANITIZER)
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
set(ENABLE_SANITIZER_ADDRESS "ENABLE_SANITIZER_ADDRESS")
set(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR "ENABLE_SANITIZER_UNDEFINED_BEHAVIOR")
else()
# or it is MSVC and has run vcvarsall
string(FIND "$ENV{PATH}" "$ENV{VSINSTALLDIR}" index_of_vs_install_dir)
if(MSVC AND "${index_of_vs_install_dir}" STREQUAL "-1")
set(ENABLE_SANITIZER_ADDRESS "ENABLE_SANITIZER_ADDRESS")
endif()
endif()
endif()
endif()

Expand Down Expand Up @@ -151,7 +164,6 @@ include(cmake/CPM.cmake)
CPMAddPackage("gh:TheLartians/[email protected]")
CPMAddPackage("gh:TheLartians/[email protected]")

#add_subdirectory(libs)

if(ENABLE_TESTING)
# This variable is set by project() in CMake 3.21+
Expand Down
6 changes: 6 additions & 0 deletions examples/example/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ RUN git pull origin master
WORKDIR $PROJECT_DIR
COPY . .
CMD ["./docker-build.sh"]

## test stage
FROM build as test
CMD ["./docker-test.sh"]

## test (coverage) stage
FROM test as test-coverage
COPY ./docker-test-coverage.sh ./docker-test-coverage.sh
CMD ["./docker-test-coverage.sh"]


# image using clang
FROM abeimler/simple-cppbuilder:clang as build-clang
Expand Down
2 changes: 1 addition & 1 deletion examples/example/cmake/CPM.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CPM_DOWNLOAD_VERSION 0.35.1)
set(CPM_DOWNLOAD_VERSION 0.36.0)

if(CPM_SOURCE_CACHE)
# Expand relative path. This is important if the provided path contains a tilde (~)
Expand Down
Loading

0 comments on commit bb0f42a

Please sign in to comment.