From e63636e3d32c209a0d3de115e61d3a68c2c80710 Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Tue, 4 Nov 2025 13:05:01 +0100 Subject: [PATCH 1/2] fix: get project compiled on msvc and clang * silence shadowing because that happens a lot in future.hpp * mark variables as maybe_unused because msvc complains in unused case of constexpr branch * enable __cplusplus makro for msvc because it is used inside the future library but not enabled by default --- cmake/CompilerWarnings.cmake | 2 +- cmake/StandardProjectSettings.cmake | 4 ++++ test/initial_draft.cpp | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index 3786c25..b1f5a5b 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -42,7 +42,7 @@ function( set(CLANG_WARNINGS -Wall -Wextra # reasonable and standard - -Wshadow # warn the user if a variable declaration shadows one from a parent context + #-Wshadow # warn the user if a variable declaration shadows one from a parent context -Wnon-virtual-dtor # warn the user if a class with virtual functions has a non-virtual destructor. This helps # catch hard to track down memory errors -Wold-style-cast # warn for c-style casts diff --git a/cmake/StandardProjectSettings.cmake b/cmake/StandardProjectSettings.cmake index b9f4123..3f45a08 100644 --- a/cmake/StandardProjectSettings.cmake +++ b/cmake/StandardProjectSettings.cmake @@ -39,6 +39,10 @@ else() message(STATUS "No colored compiler diagnostic set for '${CMAKE_CXX_COMPILER_ID}' compiler.") endif() +# Enable __cplusplus makro on MSVC which is disabled by default +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_compile_options($<$:/Zc:__cplusplus>) +endif() # run vcvarsall when msvc is used include("${CMAKE_CURRENT_LIST_DIR}/VCEnvironment.cmake") diff --git a/test/initial_draft.cpp b/test/initial_draft.cpp index 339ea8a..d0c21bc 100644 --- a/test/initial_draft.cpp +++ b/test/initial_draft.cpp @@ -123,7 +123,7 @@ class chain { /// for computing the result type of this chain. static consteval auto result_type_helper(Tail&& tail, segment&& head) { return detail::fold_over( - [](auto fold, auto&& first, auto&&... rest) { + []([[maybe_unused]] auto fold, auto&& first, auto&&... rest) { if constexpr (sizeof...(rest) == 0) { return [_segment = STLAB_FWD(first)](auto&&... args) mutable { return std::move(_segment).result_type_helper(STLAB_FWD(args)...); @@ -141,7 +141,7 @@ class chain { template auto expand(const R& receiver) && { return detail::fold_over( - [receiver](auto fold, auto&& first, auto&&... rest) { + [receiver]([[maybe_unused]] auto fold, auto&& first, auto&&... rest) { if constexpr (sizeof...(rest) == 0) { return [receiver, _segment = STLAB_FWD(first).append(receiver)](auto&&... args) mutable { From 58bb11a503ad49eec1f18fd04abe92532badb4f0 Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Tue, 4 Nov 2025 14:03:13 +0100 Subject: [PATCH 2/2] Remove cli as dependency because it is not needed and the referenced version fails to compile with CMake 4.x --- Dependencies.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Dependencies.cmake b/Dependencies.cmake index 2978210..2b4e2b5 100644 --- a/Dependencies.cmake +++ b/Dependencies.cmake @@ -36,10 +36,6 @@ endif() cpmaddpackage("gh:catchorg/Catch2@3.3.2") endif() - if(NOT TARGET CLI11::CLI11) - cpmaddpackage("gh:CLIUtils/CLI11@2.3.2") - endif() - if(NOT TARGET ftxui::screen) cpmaddpackage("gh:ArthurSonzogni/FTXUI#e23dbc7473654024852ede60e2121276c5aab660") endif()