<commit_before>diff --git a/build/BUILD.gn b/build/BUILD.gn
index d8dc6cd..4f55b5f 100644
--- a/build/BUILD.gn
+++ b/build/BUILD.gn
@@ -44,10 +44,23 @@ if (mini_chromium_is_mac) {
     # win_sdk\bin\SetEnv.cmd inside this path will be used to configure the
     # Windows toolchain.
     win_toolchain_path = "<autodetect>"
+
+    # linktime optimization (enables compiler flag /GL and linker flag /LTCG)
+    linktime_optimization = true
+
+    # Link CRT dynamically or statically
+    dynamic_crt = false
   }
 }
 
 config("debug") {
+  if (mini_chromium_is_win) {
+    if (dynamic_crt) {
+      cflags = [ "/MDd" ]
+    } else {
+      cflags = [ "/MTd" ]
+    }
+  }
 }
 
 config("release") {
@@ -69,7 +82,6 @@ config("release") {
     }
   } else if (mini_chromium_is_win) {
     cflags = [
-      "/GL",  # LTCG.
       "/O2",
       "/Ob2",  # Both explicit and auto inlining.
       "/Oy-",  # Disable omitting frame pointers, must be after /O2.
@@ -78,10 +90,20 @@ config("release") {
     ]
     ldflags = [
       "/OPT:ICF",
-      "/OPT:REF",
-      "/LTCG",
+      "/OPT:REF"
     ]
-    arflags = [ "/LTCG" ]
+
+    if (linktime_optimization) {
+      cflags += [ "/GL" ] # LTCG
+      ldflags += [ "/LTCG" ]
+      arflags = [ "/LTCG" ]
+    }
+
+    if (dynamic_crt) {
+      cflags += [ "/MD" ]
+    } else {<commit_msg>fix windows_adaptions patch as commit was updated<commit_after>diff --git a/build/BUILD.gn b/build/BUILD.gn
index d8dc6cd..4f55b5f 100644
--- a/build/BUILD.gn
+++ b/build/BUILD.gn
@@ -39,10 +39,23 @@ if (mini_chromium_is_mac) {
     # win_sdk\bin\SetEnv.cmd inside this path will be used to configure the
     # Windows toolchain.
     win_toolchain_path = "<autodetect>"
+
+    # linktime optimization (enables compiler flag /GL and linker flag /LTCG)
+    linktime_optimization = true
+
+    # Link CRT dynamically or statically
+    dynamic_crt = false
   }
 }
 
 config("debug") {
+  if (mini_chromium_is_win) {
+    if (dynamic_crt) {
+      cflags = [ "/MDd" ]
+    } else {
+      cflags = [ "/MTd" ]
+    }
+  }
 }
 
 config("release") {
@@ -64,7 +77,6 @@ config("release") {
     }
   } else if (mini_chromium_is_win) {
     cflags = [
-      "/GL",  # LTCG.
       "/O2",
       "/Ob2",  # Both explicit and auto inlining.
       "/Oy-",  # Disable omitting frame pointers, must be after /O2.
@@ -73,10 +85,20 @@ config("release") {
     ]
     ldflags = [
       "/OPT:ICF",
-      "/OPT:REF",
-      "/LTCG",
+      "/OPT:REF"
     ]
-    arflags = [ "/LTCG" ]
+
+    if (linktime_optimization) {
+      cflags += [ "/GL" ] # LTCG
+      ldflags += [ "/LTCG" ]
+      arflags = [ "/LTCG" ]
+    }
+
+    if (dynamic_crt) {
+      cflags += [ "/MD" ]
+    } else {
{'fraction_non_alphanumeric': 0.17759764185703758, 'fraction_numerical': 0.027266028002947678, 'mean_word_length': 2.160651920838184, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '14297', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1055, 'n_words': 218}