From 2f18a88e68af42bdda0e5210f80fac07ae756bd6 Mon Sep 17 00:00:00 2001 From: theflashwin Date: Tue, 5 May 2026 16:03:05 -0400 Subject: [PATCH] fix GCC PCH Breakage Triggered by fmt Scoped #pragma GCC optimize(0g) --- include/fmt/base.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index be7a40d5..9e55ba1e 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -224,9 +224,14 @@ # define FMT_PRAGMA_CLANG(x) #endif +#ifndef FMT_USE_OPTIMIZE_PRAGMA +# define FMT_USE_OPTIMIZE_PRAGMA 1 +#endif + // Enable minimal optimizations for more compact code in debug mode. FMT_PRAGMA_GCC(push_options) -#if !defined(__OPTIMIZE__) && !defined(__CUDACC__) && !defined(FMT_MODULE) +#if FMT_USE_OPTIMIZE_PRAGMA && !defined(__OPTIMIZE__) && \ + !defined(__CUDACC__) && !defined(FMT_MODULE) FMT_PRAGMA_GCC(optimize("Og")) #endif