From b56b56a695ff0c810e51a07d5f26e5f28c159ac8 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 02:17:51 -0400 Subject: [PATCH] Reformat some long warning-flag-setting lines --- CMakeLists.txt | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e706016..acddf23f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,12 +24,13 @@ option(SANITIZERS "Build with sanitizers enabled" OFF) cmake_dependent_option(MORE_WARNINGS "Turn on more warnings" OFF !MSVC OFF) if(MSVC) - # MSVC's own standard library triggers warning C5105, - # "macro expansion producing 'defined' has undefined behavior". - # Warning C5030 is about unknown attributes (`[[gnu::ATTR]]`), none of ours being load-bearing. - # Warning C4996 is about using POSIX names, which we want to do for portability. - # We also opt into the C++20-conformant preprocessor. - add_compile_options(/MP /wd5105 /wd5030 /wd4996 /Zc:preprocessor) + add_compile_options( + /MP # Build multiple files in parallel. + /wd5105 # MSVC's own standard library triggers warning C5105, "macro expansion producing 'defined' has undefined behavior". + /wd5030 # Warning C5030 is about unknown attributes (`[[gnu::ATTR]]`), none of ours being load-bearing. + /wd4996 # Warning C4996 is about using POSIX names, which we want to do for portability. + /Zc:preprocessor # Opt into the C++20-conformant preprocessor. + ) add_definitions(/D_CRT_SECURE_NO_WARNINGS) if(SANITIZERS) @@ -39,12 +40,10 @@ if(MSVC) add_link_options(${SAN_FLAGS}) endif() else() - add_compile_options(-Wall -pedantic) - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # C++20 allows macros to take zero variadic arguments, but Clang (aka AppleClang on macOS) - # does not recognize this yet. - add_compile_options(-Wno-gnu-zero-variadic-macro-arguments) - endif() + add_compile_options(-Wall -pedantic + # C++20 allows macros to take zero variadic arguments. + # Some versions of Clang don't recognize this, and treat them as a GNU extension. + -Wno-gnu-zero-variadic-macro-arguments) if(SANITIZERS) message(STATUS "ASan and UBSan enabled") set(SAN_FLAGS -fsanitize=address -fsanitize=undefined