Skip to content

Truly independent web browser

LibWebView: Report the CMake build type as the build configuration

Jelle Raaijmakers1157e9830517
diff --git a/Libraries/LibCore/BrowserVersion.h.in b/Libraries/LibCore/BrowserVersion.h.in
index f3d56a74e42..8c768f8f846 100644
--- a/Libraries/LibCore/BrowserVersion.h.in
+++ b/Libraries/LibCore/BrowserVersion.h.in
@@ -7,5 +7,6 @@
#pragma once
#define BROWSER_VERSION "@LADYBIRD_BROWSER_VERSION@"
+#define BROWSER_BUILD_CONFIGURATION "@CMAKE_BUILD_TYPE@"
#define BROWSER_RELEASE_STAGE "@browser_release_stage@"
#define BROWSER_PRODUCT_NAME "@browser_product_name@"
diff --git a/Libraries/LibWebView/CrashReport.cpp b/Libraries/LibWebView/CrashReport.cpp
index 6ed4fc5c23e..0410574a5d2 100644
--- a/Libraries/LibWebView/CrashReport.cpp
+++ b/Libraries/LibWebView/CrashReport.cpp
@@ -92,11 +92,7 @@ static void append_build_description(StringBuilder& builder, ProcessType process
static void append_system_description(StringBuilder& builder)
{
-# ifdef NDEBUG
- builder.append("Build configuration: release\n"sv);
-# else
- builder.append("Build configuration: debug\n"sv);
-# endif
+ builder.appendff("Build configuration: {}\n", BROWSER_BUILD_CONFIGURATION);
utsname system {};
if (uname(&system) == 0) {
// Only the numeric release, never nodename or custom kernel build text.
diff --git a/Libraries/LibWebView/WebCompatReport.cpp b/Libraries/LibWebView/WebCompatReport.cpp
index d5ca99a2bfc..c51147af2a5 100644
--- a/Libraries/LibWebView/WebCompatReport.cpp
+++ b/Libraries/LibWebView/WebCompatReport.cpp
@@ -28,11 +28,7 @@ static constexpr auto browser_version = BROWSER_VERSION ""sv;
static constexpr auto platform = OS_STRING ""sv;
static constexpr auto architecture = CPU_STRING ""sv;
-#ifdef NDEBUG
-static constexpr auto build_configuration = "release"sv;
-#else
-static constexpr auto build_configuration = "debug"sv;
-#endif
+static constexpr auto build_configuration = BROWSER_BUILD_CONFIGURATION ""sv;
static String to_string(StringView text)
{