[libadwaita/msvc: 17/20] build: Skip building examples on MSVC
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/msvc: 17/20] build: Skip building examples on MSVC
- Date: Tue, 18 Jan 2022 08:16:44 +0000 (UTC)
commit 589b965e5621b8f05c952308ec45b646800d8a7a
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Jan 18 11:58:29 2022 +0800
build: Skip building examples on MSVC
...and revert the changes to drop g_autoptr() there.
examples/hello-world/hello.c | 8 ++------
examples/meson.build | 4 ++++
meson_options.txt | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/examples/hello-world/hello.c b/examples/hello-world/hello.c
index e6b2e70d..632e1fc4 100644
--- a/examples/hello-world/hello.c
+++ b/examples/hello-world/hello.c
@@ -16,15 +16,11 @@ int
main (int argc,
char *argv[])
{
- AdwApplication *app = NULL;
- int result;
+ g_autoptr (app) = NULL;
app = adw_application_new ("org.example.Hello", G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate_cb), NULL);
- result = g_application_run (G_APPLICATION (app), argc, argv);
-
- g_object_unref (app);
- return result;
+ return g_application_run (G_APPLICATION (app), argc, argv);
}
diff --git a/examples/meson.build b/examples/meson.build
index bbacb3f4..2b732971 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -1,5 +1,9 @@
+if cc.get_id() != 'msvc'
+
if get_option('examples')
subdir('hello-world')
endif
+
+endif
diff --git a/meson_options.txt b/meson_options.txt
index a136a963..b95d0ae4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -19,4 +19,4 @@ option('tests',
option('examples',
type: 'boolean', value: true,
- description: 'Build and install the examples and demo applications')
+ description: 'Build and install the examples and demo applications (currently not built for MSVC
builds)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]