From dc9e22940a0febaa989c4a4a57cd3f41be8d12c9 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Mon, 13 Nov 2023 11:59:40 +0100 Subject: [PATCH 1/2] [FIX] libc++: header tests --- include/seqan3/core/debug_stream/debug_stream_type.hpp | 2 +- include/seqan3/utility/simd/detail/builtin_simd.hpp | 2 +- test/header/CMakeLists.txt | 7 +++++-- test/include/seqan3/test/pretty_printing.hpp | 1 + test/seqan3-test.cmake | 2 ++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/seqan3/core/debug_stream/debug_stream_type.hpp b/include/seqan3/core/debug_stream/debug_stream_type.hpp index 9dae4e382f..2671f49df8 100644 --- a/include/seqan3/core/debug_stream/debug_stream_type.hpp +++ b/include/seqan3/core/debug_stream/debug_stream_type.hpp @@ -155,7 +155,7 @@ class debug_stream_type //!\} //!\brief This type is std::ios_base::fmtflags - using fmtflags = decltype(std::declval>().flags()); + using fmtflags = typename std::basic_ostream::fmtflags; /*!\name Format flags (std::ios_base::fmtflags) * \brief std::ios_base::fmtflags that modify the stream's behaviour. diff --git a/include/seqan3/utility/simd/detail/builtin_simd.hpp b/include/seqan3/utility/simd/detail/builtin_simd.hpp index bd1f8bbf33..dc92928b81 100644 --- a/include/seqan3/utility/simd/detail/builtin_simd.hpp +++ b/include/seqan3/utility/simd/detail/builtin_simd.hpp @@ -134,7 +134,7 @@ constexpr bool is_builtin_simd_v = is_builtin_simd::value; * seqan3::detail::builtin_simd types. */ template <> -constexpr auto default_simd_max_length = []() +inline constexpr auto default_simd_max_length = []() { #if defined(__AVX512F__) return min_viable_uint_v<64u>; diff --git a/test/header/CMakeLists.txt b/test/header/CMakeLists.txt index d28ade8a93..5bfab0be52 100644 --- a/test/header/CMakeLists.txt +++ b/test/header/CMakeLists.txt @@ -84,7 +84,7 @@ macro (seqan3_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} seqan3::test::header) + target_link_libraries (${target} seqan3::test seqan3::test::header) add_test (NAME "header/${target}" COMMAND ${target}) foreach (header ${header_files}) @@ -112,7 +112,10 @@ macro (seqan3_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} seqan3::test::header) + # Link seqan3::test first, even though it is also linked by seqan3::test:header. + # Without this, the compile options of seqan3::test are appended, e.g., + # `-Wno-error=... -Werror -Wall`, instead of `-Werror -Wall -Wno-error=...` + target_link_libraries (${header_target} seqan3::test seqan3::test::header) target_sources (${target} PRIVATE $) endforeach () endforeach () diff --git a/test/include/seqan3/test/pretty_printing.hpp b/test/include/seqan3/test/pretty_printing.hpp index e929106309..bb95f2e311 100644 --- a/test/include/seqan3/test/pretty_printing.hpp +++ b/test/include/seqan3/test/pretty_printing.hpp @@ -14,6 +14,7 @@ #include #include +#include #include diff --git a/test/seqan3-test.cmake b/test/seqan3-test.cmake index 7f35f13ff2..f19dc33f4a 100644 --- a/test/seqan3-test.cmake +++ b/test/seqan3-test.cmake @@ -120,6 +120,8 @@ if (NOT TARGET seqan3::test::header) add_library (seqan3_test_header INTERFACE) target_link_libraries (seqan3_test_header INTERFACE "seqan3::test::unit") target_link_libraries (seqan3_test_header INTERFACE "seqan3::test::performance") + target_compile_options (seqan3_test_header INTERFACE "-Wno-unused-const-variable" "-Wno-unused-variable" + "-Wno-unused-function") target_compile_definitions (seqan3_test_header INTERFACE -DSEQAN3_DISABLE_DEPRECATED_WARNINGS) target_compile_definitions (seqan3_test_header INTERFACE -DSEQAN3_HEADER_TEST) add_library (seqan3::test::header ALIAS seqan3_test_header) From b447e2f67b2cda785e3955ecd5e40179f0d0632c Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Mon, 13 Nov 2023 12:01:26 +0100 Subject: [PATCH 2/2] [INFRA] Add libc++ header test CI --- .github/workflows/ci_misc.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci_misc.yml b/.github/workflows/ci_misc.yml index df98a2459a..0cd25de316 100644 --- a/.github/workflows/ci_misc.yml +++ b/.github/workflows/ci_misc.yml @@ -43,6 +43,13 @@ jobs: build_type: Release test_threads: 2 + - name: "Header clang17 libc++" + compiler: "clang-17" + build: header + build_type: Release + test_threads: 2 + cxx_flags: "-stdlib=libc++" + - name: "Header gcc13" compiler: "gcc-13" build: header