summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2020-04-19 20:35:37 +0200
committerPatrick <tingping@tingping.se>2020-04-19 16:12:42 -0700
commit83daed87061830a140dcbf425ffa78c0ac0f4d4c (patch)
tree67ed1b678b3675d4a1f74a28a3dfceb4c0dd2035 /src
parent5d5838e71247e43b6e8db306055d8f93326ef86b (diff)
win32: Fix building executables with invalid entrypoints
Windows builds of the GTK frontend use the pie flag to compile
hexchat.exe. Windows needs an explicit entrypoint when compiling with
--pie, otherwise an invalid executable is created.

This sets the entrypoint of the executable on Windows (as it is
currently set in the Visual Studio project files).

This fixes a critical build issue which prevents all Windows builds
using Meson from working.
Diffstat (limited to 'src')
-rw-r--r--src/fe-gtk/meson.build4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fe-gtk/meson.build b/src/fe-gtk/meson.build
index 1fe741ee..3dfc7427 100644
--- a/src/fe-gtk/meson.build
+++ b/src/fe-gtk/meson.build
@@ -80,6 +80,10 @@ resources = gnome.compile_resources('resources',
   extra_args: ['--manual-register']
 )
 
+if host_machine.system() == 'windows'
+  hexchat_gtk_ldflags += '-Wl,-e,mainCRTStartup'
+endif
+
 executable('hexchat',
   sources:  resources + hexchat_gtk_sources,
   dependencies: hexchat_gtk_deps,