[GWP-ASan] Respect GWP_ASAN_DEFAULT_ENABLED compile-time macro

If the containing allocator build uses -DGWP_ASAN_DEFAULT_ENABLED=false
then the option will default to false.  For e.g. Scudo, this is simpler
and more efficient than using -DSCUDO_DEFAULT_OPTIONS=... to set gwp-asan
options that have to be parsed from the string at startup.

Reviewed By: hctim

Differential Revision: https://reviews.llvm.org/D91463

GitOrigin-RevId: 7810d837864933b49f5e20a970a8e51ea091fa8e
diff --git a/options.inc b/options.inc
index c81e1f4..67dcfae 100644
--- a/options.inc
+++ b/options.inc
@@ -10,7 +10,18 @@
 #error "Define GWP_ASAN_OPTION prior to including this file!"
 #endif
 
-GWP_ASAN_OPTION(bool, Enabled, true, "Is GWP-ASan enabled? Defaults to true.")
+#ifndef GWP_ASAN_DEFAULT_ENABLED
+#define GWP_ASAN_DEFAULT_ENABLED true
+#endif
+
+#ifndef GWP_ASAN_STRINGIFY
+#define GWP_ASAN_STRINGIFY(S) GWP_ASAN_STRINGIFY_(S)
+#define GWP_ASAN_STRINGIFY_(S) #S
+#endif
+
+GWP_ASAN_OPTION(bool, Enabled, GWP_ASAN_DEFAULT_ENABLED,
+                "Is GWP-ASan enabled? Defaults to " GWP_ASAN_STRINGIFY(
+                    GWP_ASAN_DEFAULT_ENABLED) ".")
 
 GWP_ASAN_OPTION(
     bool, PerfectlyRightAlign, false,