From 3a6df1dbe4ee9d92fb8f94bb6290b303bcc0bef1 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 3 Aug 2026 18:33:46 +0800 Subject: [PATCH] Add -mbig-obj flag for windows debug builds --- R/compiler-flags.R | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/R/compiler-flags.R b/R/compiler-flags.R index 3d4f3cc..948e450 100644 --- a/R/compiler-flags.R +++ b/R/compiler-flags.R @@ -59,6 +59,19 @@ compiler_flags <- function(debug = FALSE) { ) res[flags] <- paste(res[flags], "-fdiagnostics-color=always") } + + if (debug && .Platform$OS.type == "windows") { + flags <- c( + "CFLAGS", + "CXXFLAGS", + "CXX11FLAGS", + "CXX14FLAGS", + "CXX17FLAGS", + "CXX20FLAGS" + ) + # Debug symbols can generate too many sections on Windows + res[flags] <- paste(res[flags], "-Wa,-mbig-obj") + } res }