diff --git a/CMakePresets.json b/CMakePresets.json index ede9472..0b645f2 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -7,7 +7,7 @@ "generator": "Ninja", "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { - "CMAKE_CXX_STANDARD": "17" + "CMAKE_CXX_STANDARD": "20" } }, { diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index b0c64eb..ba8168b 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,8 +1,21 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -set(ALL_EXAMPLES # identity_as_default_projection - identity_direct_usage -) +set(ALL_EXAMPLES identity_direct_usage) + +# Example `identity_as_default_projection` need ranges support: +include(CheckCXXSymbolExists) +check_cxx_symbol_exists(__cpp_lib_ranges "ranges" HAS_RANGES) + +if(HAS_RANGES) + list(APPEND ALL_EXAMPLES identity_as_default_projection) +else() + message( + WARNING + "Missing range support! Skip: identity_as_default_projection" + ) +endif() + +message("Examples to be built: ${ALL_EXAMPLES}") foreach(example ${ALL_EXAMPLES}) add_executable(beman.exemplar.examples.${example})