[libadwaita/msvc: 1/4] build: Skip building examples on MSVC




commit a452ab0355185d02d6580cf8f8419a2b6b74baea
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         | 7 +++++++
 meson_options.txt            | 2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/examples/hello-world/hello.c b/examples/hello-world/hello.c
index e6b2e70d..7a1409e8 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 (AdwApplication) 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..a2a05fc6 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -1,3 +1,10 @@
+if cc.get_id() == 'msvc'
+
+  message('Skipping examples while building with Visual Studio')
+  subdir_done()
+
+endif
+
 if get_option('examples')
 
 subdir('hello-world')
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]