[sysprof] build: use -Ddevelopment=true to set DEVELOPMENT_BUILD



commit 97633fd0110b7d21bb9c32a742d8ac6c3bb0e282
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jul 22 12:53:25 2022 -0700

    build: use -Ddevelopment=true to set DEVELOPMENT_BUILD
    
    And also, we use it as #ifdef, so never define it as 0.

 meson.build                  | 4 +++-
 meson_options.txt            | 5 +++++
 org.gnome.Sysprof.Devel.json | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 71782cd9..3dbac8cd 100644
--- a/meson.build
+++ b/meson.build
@@ -90,7 +90,9 @@ if get_option('libunwind')
 endif
 
 # Development build setup
-config_h.set('DEVELOPMENT_BUILD', version_split[1].to_int().is_odd())
+if get_option('development')
+  config_h.set10('DEVELOPMENT_BUILD', true)
+endif
 
 has_use_clockid = cc.has_member('struct perf_event_attr', 'use_clockid', prefix: '#include 
<linux/perf_event.h>')
 has_clockid = cc.has_member('struct perf_event_attr', 'clockid', prefix: '#include <linux/perf_event.h>')
diff --git a/meson_options.txt b/meson_options.txt
index 6644185d..6d94a0bd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,8 @@
+# If this is a development build, which is used for our Flatpak build
+# so that we have a different app-id (.Devel suffix) than the regular
+# application.
+option('development', type: 'boolean', value: 'false')
+
 # Optionally disable the GTK application in case you're building the
 # sysprof-cli only for your platform. Might be useful in IoT or various
 # server scenarios.
diff --git a/org.gnome.Sysprof.Devel.json b/org.gnome.Sysprof.Devel.json
index 933b252d..cf24683f 100644
--- a/org.gnome.Sysprof.Devel.json
+++ b/org.gnome.Sysprof.Devel.json
@@ -104,6 +104,7 @@
                 "--libdir=/app/lib",
                 "--buildtype=debugoptimized",
                 "-Dagent=true",
+                "-Ddevelopment=true",
                 "-Dlibsysprof=true",
                 "-Dgtk=true",
                 "-Dsysprofd=host"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]