[libhandy/msvc: 8/11] demo app: Fix linking on Visual Studio-style builds




commit 639bdd1422e1c32bdabff289b3849679e3c222ce
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jan 19 18:06:06 2022 +0800

    demo app: Fix linking on Visual Studio-style builds
    
    We must pass in '/entry:mainCRTStartup' so that things will link when
    building GTK-based apps with 'gui_app: true' (i.e. '/subsystem:windows'
    for Visual Studio builds).

 examples/meson.build | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/examples/meson.build b/examples/meson.build
index 7205c3d1..908c54ef 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -18,9 +18,16 @@ handy_demo_sources = [
   libhandy_generated_headers,
 ]
 
+demo_link_args = []
+
+if cc.get_argument_syntax() == 'msvc'
+  demo_link_args += '/entry:mainCRTStartup'
+endif
+
 handy_demo = executable('handy-@0@-demo'.format(apiversion),
   handy_demo_sources,
   dependencies: libhandy_dep,
+  link_args: demo_link_args,
   gui_app: true,
   install: true,
 )


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