Skip to content

Commit 2f18a88

Browse files
theflashwinvitaut
authored andcommitted
fix GCC PCH Breakage Triggered by fmt Scoped #pragma GCC optimize(0g)
1 parent 9cb8c0f commit 2f18a88

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

include/fmt/base.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,14 @@
224224
# define FMT_PRAGMA_CLANG(x)
225225
#endif
226226

227+
#ifndef FMT_USE_OPTIMIZE_PRAGMA
228+
# define FMT_USE_OPTIMIZE_PRAGMA 1
229+
#endif
230+
227231
// Enable minimal optimizations for more compact code in debug mode.
228232
FMT_PRAGMA_GCC(push_options)
229-
#if !defined(__OPTIMIZE__) && !defined(__CUDACC__) && !defined(FMT_MODULE)
233+
#if FMT_USE_OPTIMIZE_PRAGMA && !defined(__OPTIMIZE__) && \
234+
!defined(__CUDACC__) && !defined(FMT_MODULE)
230235
FMT_PRAGMA_GCC(optimize("Og"))
231236
#endif
232237

0 commit comments

Comments
 (0)