Skip to content

Commit

Permalink
Merge pull request #213 from eseiler/infra/stdlibc++
Browse files Browse the repository at this point in the history
[INFRA] Add stdlibc++ CI
  • Loading branch information
eseiler authored Nov 29, 2023
2 parents 9e8b79d + e58b67d commit 3e96d37
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
compiler: "clang-17"
build: unit
build_type: Release
cxx_flags: "-stdlib=libc++"

- name: "gcc13"
compiler: "gcc-13"
Expand All @@ -56,6 +57,12 @@ jobs:
build: unit
build_type: Release

- name: "IntelLLVM"
compiler: "intel"
build: unit
build_type: Release
cxx_flags: "-fp-model=strict"

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -71,6 +78,7 @@ jobs:
ccache_size: 75M

- name: Install CMake
if: contains(matrix.compiler, 'intel') == false
uses: seqan/actions/setup-cmake@main
with:
cmake: 3.16.9
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ jobs:
fail-fast: true
matrix:
include:
- name: "clang17"
compiler: "clang-17"
build: unit
build_type: Release
cxx_flags: "-stdlib=libc++" # For verbosity. This is already the default.

- name: "gcc13"
compiler: "gcc-13"
build: unit
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/ci_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,26 @@ jobs:
fail-fast: false
matrix:
include:
- name: "Snippet clang17"
compiler: "clang-17"
build: snippet
build_type: Release
cxx_flags: "-stdlib=libc++"
test_threads: 1

- name: "Snippet gcc11"
compiler: "gcc-11"
build: snippet
build_type: Release
test_threads: 1 # snippets create and delete files and some separate tests create/delete the same files

- name: "Header clang17"
compiler: "clang-17"
build: header
build_type: Release
cxx_flags: "-stdlib=libc++"
test_threads: 2

- name: "Header gcc13"
compiler: "gcc-13"
build: header
Expand Down Expand Up @@ -78,6 +92,7 @@ jobs:
mkdir sharg-build
cd sharg-build
cmake ../sharg/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSHARG_VERBOSE_TESTS=OFF
case "${{ matrix.build }}" in
snippet) make -j2 gtest_build yaml-cpp;;
Expand Down
1 change: 1 addition & 0 deletions include/sharg/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cstddef>
#include <cstdint>

/*!\file
Expand Down
7 changes: 5 additions & 2 deletions test/header/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ macro (sharg_header_test component header_base_path exclude_regex)

file (WRITE "${PROJECT_BINARY_DIR}/${target}.cpp" "")
add_executable (${target} ${PROJECT_BINARY_DIR}/${target}.cpp)
target_link_libraries (${target} sharg::test::header)
target_link_libraries (${target} sharg::test sharg::test::header)
add_test (NAME "header/${target}" COMMAND ${target})

foreach (header ${header_files})
Expand All @@ -48,7 +48,10 @@ macro (sharg_header_test component header_base_path exclude_regex)
"${CMAKE_CURRENT_SOURCE_DIR}/generate_header_source.cmake")
add_library (${header_target} OBJECT "${header_target_source}")

target_link_libraries (${header_target} sharg::test::header)
# Link sharg::test first, even though it is also linked by sharg::test:header.
# Without this, the compile options of sharg::test are appended, e.g.,
# `-Wno-error=... -Werror -Wall`, instead of `-Werror -Wall -Wno-error=...`
target_link_libraries (${header_target} sharg::test sharg::test::header)

target_sources (${target} PRIVATE $<TARGET_OBJECTS:${header_target}>)
endforeach ()
Expand Down
1 change: 1 addition & 0 deletions test/sharg-test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ if (NOT TARGET sharg::test::header)
add_library (sharg_test_header INTERFACE)
target_link_libraries (sharg_test_header INTERFACE "sharg::test::unit")
target_link_libraries (sharg_test_header INTERFACE "sharg::test::performance")
target_compile_options (sharg_test_header INTERFACE "-Wno-unused-const-variable")
target_compile_definitions (sharg_test_header INTERFACE -DSHARG_DISABLE_DEPRECATED_WARNINGS)
target_compile_definitions (sharg_test_header INTERFACE -DSHARG_HEADER_TEST)
add_library (sharg::test::header ALIAS sharg_test_header)
Expand Down
4 changes: 4 additions & 0 deletions test/unit/detail/type_name_as_string_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ class type_inspection : public ::testing::Test
else if constexpr (std::is_same_v<param_type, foo::bar<char> const &>)
return "foo::bar<char> const &";
else if constexpr (std::is_same_v<param_type, foo::bar<foo::bar<char, double>>>)
#ifdef _LIBCPP_VERSION
return "foo::bar<foo::bar<char, double>>";
#else
return "foo::bar<foo::bar<char, double> >";
#endif
else
throw std::runtime_error{"Encountered unknown type in test."};
}
Expand Down

1 comment on commit 3e96d37

@vercel
Copy link

@vercel vercel bot commented on 3e96d37 Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sharg-parser – ./

sharg-parser-git-main-seqan.vercel.app
sharg.vercel.app
sharg-100.vercel.app
sharg-parser-seqan.vercel.app

Please sign in to comment.