cmake_minimum_required(VERSION 3.30) project(tour_cpp26 LANGUAGES CXX) # C++26, strictly: no gnu extensions, no fallbacks to older standards. set(CMAKE_CXX_STANDARD 26) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) option(BOOK_SANITIZE "Run example tests under AddressSanitizer and UndefinedBehaviorSanitizer" ON) option(BOOK_ENABLE_GAPS "Build examples for C++26 features without shipping Clang support" OFF) option(BOOK_WERROR "Turn compiler warnings into errors for book_example targets" ON) # clang-tidy is part of the compiler surface for this book. Demos opt out # per-target (see book_demo in cmake/BookExample.cmake). find_program(CLANG_TIDY_EXE NAMES clang-tidy) if(CLANG_TIDY_EXE) set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}") else() message(WARNING "clang-tidy not found; the compiler committee is incomplete") endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") include(BookExample) enable_testing() add_subdirectory(examples)