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 }