summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2018-03-28 12:13:08 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2018-04-02 19:11:50 +0800
commit19ce520c2d8b37fd67bed3aaf8dbfa0e62df4454 (patch)
treefcae8b20511d9d7cf325c1cd754b1efbfd520210 /meson.build
parentd0e46d257c876e2c663d90064faed371f7e6cd4f (diff)
downloadgtk+-19ce520c2d8b37fd67bed3aaf8dbfa0e62df4454.tar.gz
build: Fix linking demos on Visual Studio
The demos are now built as GUI programs, which will require the presence of WinMain() on Visual Studio builds, unless we specify the entry point. Pass the /entry:mainCRTStartup linker flag on Visual Studio builds for the demo programs so that they can link properly. https://bugzilla.gnome.org/show_bug.cgi?id=773299
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build8
1 files changed, 7 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index e998d99314..a84eaf374a 100644
--- a/meson.build
+++ b/meson.build
@@ -559,9 +559,15 @@ if quartz_enabled
backend_immodules += ['quartz']
endif
+extra_demo_ldflags = []
if win32_enabled
pc_gdk_extra_libs += ['-lgdi32', '-limm32', '-lshell32', '-lole32']
- if cc.get_id() != 'msvc'
+ if cc.get_id() == 'msvc'
+ # Since the demo programs are now built as pure GUI programs, we
+ # need to pass in /entry:mainCRTStartup so that they will properly
+ # link on Visual Studio builds
+ extra_demo_ldflags = ['/entry:mainCRTStartup']
+ else
pc_gdk_extra_libs += ['-Wl,-luuid']
endif
pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32']