diff --git a/.github/actions/spelling/allow/uncategorized.txt b/.github/actions/spelling/allow/uncategorized.txt index d8a34ea7d1..dc5b681004 100644 --- a/.github/actions/spelling/allow/uncategorized.txt +++ b/.github/actions/spelling/allow/uncategorized.txt @@ -32,6 +32,7 @@ DATAROOTDIR DBus DCCACHE DCMAKE +DNDEBUG DCODE DCONTOUR DEFGHIJKL diff --git a/CMakeLists.txt b/CMakeLists.txt index f80f8560a5..36bbb48cde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,12 @@ if(DEFINED MSVC) add_compile_options(/nologo) endif() + +# CMAKE_BUILD_TYPE check for None +if(CMAKE_BUILD_TYPE STREQUAL "None") + add_compile_definitions(-DNDEBUG) +endif() + if (CONTOUR_BUILD_WITH_MIMALLOC) add_definitions(-DCONTOUR_BUILD_WITH_MIMALLOC) endif() diff --git a/src/contour/Actions.h b/src/contour/Actions.h index 687a04dfce..3a3ed39cb5 100644 --- a/src/contour/Actions.h +++ b/src/contour/Actions.h @@ -282,7 +282,11 @@ namespace documentation constexpr inline std::string_view SwitchToTabRight { "Switch to tab to the right" }; } // namespace documentation -inline auto getDocumentation() +#if defined(__clang__) && __clang_major__ >= 19 +constexpr +#endif + inline auto + getDocumentation() { return std::array { std::tuple { Action { CancelSelection {} }, documentation::CancelSelection }, @@ -348,6 +352,10 @@ inline auto getDocumentation() }; } +#if defined(__clang__) && __clang_major__ >= 19 +static_assert(getDocumentation().size() == std::variant_size_v); +#endif + } // namespace contour::actions // {{{ fmtlib custom formatters