From c7b345f73e66e4699d8fc012fe2316ff76809bcb Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 18 Jan 2024 16:33:48 -0500 Subject: [PATCH] build: Move and rename demo_conf.h header We want to use the same header in the inspector, so move it to the toplevel. And since it is no longer for demos only, rename it to profile_conf.h, and also rename the build option back to profile. --- .../{gen-demo-header.py => gen-profile-conf.py} | 0 demos/gtk-demo/main.c | 2 +- demos/gtk-demo/meson.build | 2 +- demos/icon-browser/iconbrowserapp.c | 2 +- demos/icon-browser/meson.build | 2 +- demos/meson.build | 13 ------------- demos/node-editor/meson.build | 2 +- demos/node-editor/node-editor-application.c | 2 +- demos/print-editor/meson.build | 2 +- demos/print-editor/print-editor.c | 2 +- demos/widget-factory/meson.build | 2 +- demos/widget-factory/widget-factory.c | 2 +- gtk/meson.build | 1 + meson.build | 12 ++++++++++++ meson_options.txt | 4 ++-- 15 files changed, 25 insertions(+), 25 deletions(-) rename build-aux/meson/{gen-demo-header.py => gen-profile-conf.py} (100%) diff --git a/build-aux/meson/gen-demo-header.py b/build-aux/meson/gen-profile-conf.py similarity index 100% rename from build-aux/meson/gen-demo-header.py rename to build-aux/meson/gen-profile-conf.py diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c index 20510b865f..3f9fe29a71 100644 --- a/demos/gtk-demo/main.c +++ b/demos/gtk-demo/main.c @@ -24,7 +24,7 @@ #include "demos.h" #include "fontify.h" -#include "demo_conf.h" +#include "profile_conf.h" static GtkWidget *info_view; static GtkWidget *source_view; diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build index 17806d3a0d..31ab905185 100644 --- a/demos/gtk-demo/meson.build +++ b/demos/gtk-demo/meson.build @@ -236,7 +236,7 @@ foreach flag: common_cflags endif endforeach -gtkdemo_deps += [ demo_conf_h ] +gtkdemo_deps += [ profile_conf_h ] executable('gtk4-demo', sources: [demos, demos_h, extra_demo_sources, gtkdemo_resources], diff --git a/demos/icon-browser/iconbrowserapp.c b/demos/icon-browser/iconbrowserapp.c index 7bfd84ff3e..17329200cb 100644 --- a/demos/icon-browser/iconbrowserapp.c +++ b/demos/icon-browser/iconbrowserapp.c @@ -4,7 +4,7 @@ #include "iconbrowserapp.h" #include "iconbrowserwin.h" -#include "demo_conf.h" +#include "profile_conf.h" struct _IconBrowserApp { diff --git a/demos/icon-browser/meson.build b/demos/icon-browser/meson.build index 9a6a52a4ce..61dcc3da54 100644 --- a/demos/icon-browser/meson.build +++ b/demos/icon-browser/meson.build @@ -14,7 +14,7 @@ iconbrowser_resources = gnome.compile_resources('iconbrowser_resources', executable('gtk4-icon-browser', sources: [iconbrowser_sources, iconbrowser_resources], c_args: common_cflags, - dependencies: [ libgtk_dep, demo_conf_h ], + dependencies: [ libgtk_dep, profile_conf_h ], include_directories: confinc, win_subsystem: 'windows', link_args: extra_demo_ldflags, diff --git a/demos/meson.build b/demos/meson.build index d4c04d2b8b..e3792cc27f 100644 --- a/demos/meson.build +++ b/demos/meson.build @@ -1,16 +1,3 @@ -gen_demo_header = find_program('../build-aux/meson/gen-demo-header.py') -demo_profile = get_option('demo-profile') - -demo_conf_h = declare_dependency( - sources: custom_target('demo-header', - command: [gen_demo_header, meson.project_source_root(), demo_profile], - capture: true, - output: 'demo_conf.h', - build_by_default: true, - build_always_stale: true, - ) -) - # appdata appdata_config = configuration_data() diff --git a/demos/node-editor/meson.build b/demos/node-editor/meson.build index 91ea0d6d69..7df42e3f6d 100644 --- a/demos/node-editor/meson.build +++ b/demos/node-editor/meson.build @@ -12,7 +12,7 @@ node_editor_resources = gnome.compile_resources('node_editor_resources', executable('gtk4-node-editor', sources: [node_editor_sources, node_editor_resources], - dependencies: [ libgtk_dep, demo_conf_h ], + dependencies: [ libgtk_dep, profile_conf_h ], include_directories: confinc, c_args: common_cflags, win_subsystem: 'windows', diff --git a/demos/node-editor/node-editor-application.c b/demos/node-editor/node-editor-application.c index 9df2b8831a..dfcc5b4aa9 100644 --- a/demos/node-editor/node-editor-application.c +++ b/demos/node-editor/node-editor-application.c @@ -25,7 +25,7 @@ #include "node-editor-window.h" -#include "demo_conf.h" +#include "profile_conf.h" static const char *css = "textview.editor {" diff --git a/demos/print-editor/meson.build b/demos/print-editor/meson.build index 6813a7f2cc..0d6d81d102 100644 --- a/demos/print-editor/meson.build +++ b/demos/print-editor/meson.build @@ -1,7 +1,7 @@ executable('gtk4-print-editor', sources: ['print-editor.c'], c_args: common_cflags, - dependencies: [ libgtk_dep, demo_conf_h ], + dependencies: [ libgtk_dep, profile_conf_h ], include_directories: confinc, win_subsystem: 'windows', link_args: extra_demo_ldflags, diff --git a/demos/print-editor/print-editor.c b/demos/print-editor/print-editor.c index 792f01cfbb..e76a996868 100644 --- a/demos/print-editor/print-editor.c +++ b/demos/print-editor/print-editor.c @@ -4,7 +4,7 @@ #include #include -#include "demo_conf.h" +#include "profile_conf.h" static GtkWidget *main_window; static GFile *filename = NULL; diff --git a/demos/widget-factory/meson.build b/demos/widget-factory/meson.build index 8e61c24869..4579a44ea6 100644 --- a/demos/widget-factory/meson.build +++ b/demos/widget-factory/meson.build @@ -66,7 +66,7 @@ endif executable('gtk4-widget-factory', sources: ['widget-factory.c', widgetfactory_resources], c_args: common_cflags, - dependencies: [ libgtk_dep, demo_conf_h ], + dependencies: [ libgtk_dep, profile_conf_h ], include_directories: confinc, win_subsystem: 'windows', link_args: extra_demo_ldflags, diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index f0cfa2e62f..1dbb1a472a 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -25,7 +25,7 @@ #include #include -#include "demo_conf.h" +#include "profile_conf.h" static void change_dark_state (GSimpleAction *action, diff --git a/gtk/meson.build b/gtk/meson.build index c15b3e09fb..072cf65e27 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -1028,6 +1028,7 @@ gtk_deps = [ epoxy_dep, libm, graphene_dep, + profile_conf_h, ] if x11_enabled diff --git a/meson.build b/meson.build index adb0afd0c0..357b6de9de 100644 --- a/meson.build +++ b/meson.build @@ -785,6 +785,18 @@ project_build_root = meson.current_build_dir() gen_visibility_macros = find_program('build-aux/meson/gen-visibility-macros.py') +gen_profile_conf = find_program('build-aux/meson/gen-profile-conf.py') + +profile_conf_h = declare_dependency( + sources: custom_target('profile-conf', + command: [gen_profile_conf, meson.project_source_root(), get_option('profile')], + capture: true, + output: 'profile_conf.h', + build_by_default: true, + build_always_stale: true, + ) +) + subdir('gdk/version') subdir('gtk/css') subdir('gdk') diff --git a/meson_options.txt b/meson_options.txt index 3b2cb8ad37..db36dd5750 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -126,13 +126,13 @@ option('demo-profile', type: 'combo', choices: [ 'default', 'devel' ], value: 'default', - description : 'Profile to use for demos') + deprecated: 'profile') option('profile', type: 'combo', choices: [ 'default', 'devel' ], value: 'default', - deprecated: 'demo-profile') + description : 'Profile to use for demos') option('build-demos', type: 'boolean',