Skip to content

Commit

Permalink
minor build system improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
KRM7 committed Aug 19, 2023
1 parent cd227aa commit 5728059
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
-readability-container-data-pointer,
-readability-suspicious-call-argument,
-readability-implicit-bool-conversion,
-readability-uppercase-literal-suffix,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-cppcoreguidelines-special-member-functions,
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@ jobs:
matrix:
build-type: [ Release, RelWithDebInfo ]
compiler: [
{ cxx: g++-11, pkgs: gcc-11 libtbb-dev },
#{ cxx: g++-12, pkgs: gcc-12 libtbb-dev }, # disabled because of warnings in the std library
{ cxx: g++-11, pkgs: g++-11 libtbb-dev },
{ cxx: g++-12, pkgs: g++-12 libtbb-dev },
{ cxx: clang++-14, pkgs: clang-14 libtbb-dev },
{ cxx: clang++-15, pkgs: clang-15 libtbb-dev },
]
lib-type: [
{ name: Static, cmake-flag: "OFF" },
{ name: Shared, cmake-flag: "ON" },
]

defaults:
run:
working-directory: ${{ github.workspace }}/build

name: ${{ matrix.compiler.cxx }}, ${{ matrix.build-type }}, ${{ matrix.lib-type.name }}
name: ${{ matrix.compiler.cxx }}, ${{ matrix.build-type }}

steps:
- name: checkout-repo
Expand All @@ -41,7 +37,7 @@ jobs:
- name: setup-build
env:
CXX: ${{ matrix.compiler.cxx }}
run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGAPP_LINK_TBB=ON -DBUILD_SHARED_LIBS=${{ matrix.lib-type.cmake-flag }}
run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGAPP_LINK_TBB=ON -DBUILD_SHARED_LIBS=OFF

- name: build
run: cmake --build . --parallel
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ else() # GNU style compiler interface

# gcc specific options
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(GAPP_WARN_FLAGS "${GAPP_WARN_FLAGS} -Wlogical-op")
# https://gcc.gnu.org/bugzilla//show_bug.cgi?id=71434 with gcc 12 even though it's a system header + pragma diagnostic doesn't work
set(GAPP_WARN_FLAGS "${GAPP_WARN_FLAGS} -Wlogical-op -Wno-maybe-uninitialized")
endif()
# clang specific options
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
6 changes: 3 additions & 3 deletions build/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ BUILD_DIR=$(dirname $(realpath "$0"))
echo -e "\nThe build directory is ${BUILD_DIR}.\n"

echo -e "Installing Debug configuration.\n"
cmake $BUILD_DIR/.. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF "$@"
cmake -S $BUILD_DIR/.. -B $BUILD_DIR -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF "$@"
cmake --build $BUILD_DIR --config Debug --parallel
cmake --install $BUILD_DIR --config Debug

echo -e "Installing RelWithDebInfo configuration.\n"
cmake $BUILD_DIR/.. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF "$@"
cmake -S $BUILD_DIR/.. -B $BUILD_DIR -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF "$@"
cmake --build $BUILD_DIR --config RelWithDebInfo --parallel
cmake --install $BUILD_DIR --config RelWithDebInfo

echo -e "Installing Release configuration.\n"
cmake $BUILD_DIR/.. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF "$@"
cmake -S $BUILD_DIR/.. -B $BUILD_DIR -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF "$@"
cmake --build $BUILD_DIR --config Release --parallel
cmake --install $BUILD_DIR --config Release
32 changes: 24 additions & 8 deletions build/install_catch.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
#!/bin/sh

git clone https://github.com/catchorg/Catch2.git
cd Catch2
git checkout tags/v3.3.0
cmake -Bbuild -S. -DBUILD_TESTING=OFF
cmake --build build/ --target install --config Debug
cmake --build build/ --target install --config Release
cmake --build build/ --target install --config RelWithDebInfo
cd ..
echo -e "Installing Catch2...\n"

git clone -b v3.3.0 https://github.com/catchorg/Catch2.git
mkdir Catch2/build

cmake --version

BUILD_DIR=$(dirname $(realpath "$0"))/Catch2/build
echo -e "\nThe build directory is ${BUILD_DIR}.\n"

echo -e "Installing Debug configuration.\n"
cmake -S $BUILD_DIR/.. -B $BUILD_DIR -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF "$@"
cmake --build $BUILD_DIR --config Debug --parallel
cmake --install $BUILD_DIR --config Debug

echo -e "Installing RelWithDebInfo configuration.\n"
cmake -S $BUILD_DIR/.. -B $BUILD_DIR -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF "$@"
cmake --build $BUILD_DIR --config RelWithDebInfo --parallel
cmake --install $BUILD_DIR --config RelWithDebInfo

echo -e "Installing Release configuration.\n"
cmake -S $BUILD_DIR/.. -B $BUILD_DIR -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF "$@"
cmake --build $BUILD_DIR --config Release --parallel
cmake --install $BUILD_DIR --config Release

0 comments on commit 5728059

Please sign in to comment.