From d2cad949bd9b62bfe44ec7aa193910f36391a63f Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 13 Feb 2022 10:31:20 +0200 Subject: [PATCH 28/28] Meson: Add icons to Windows executables See osdn #43579 Signed-off-by: Marko Lindqvist --- meson.build | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index a3d326382c..e28bcb5100 100644 --- a/meson.build +++ b/meson.build @@ -559,6 +559,24 @@ tolua_signal = custom_target('tolua_signal', '-H', '@OUTPUT1@', files('common/scriptcore/tolua_signal.pkg')]) +if host_system == 'windows' + windres_cmd = find_program('x86_64-w64-mingw32-windres', 'windres') + windres = generator(windres_cmd, + arguments: ['-I', '@SRC_DIR@/windows', + '-i', '@INPUT@', + '-o', '@OUTPUT@'], + output: '@BASENAME@.o') + clienticon = windres.process('windows/clienticon.rc') + mpicon = windres.process('windows/mpicon.rc') + rulediticon = windres.process('windows/rulediticon.rc') + servericon = windres.process('windows/servericon.rc') +else + clienticon = [] + mpicon = [] + rulediticon = [] + servericon = [] +endif + common_lib = library('freeciv', 'utility/astring.c', 'utility/bitvector.c', @@ -804,6 +822,7 @@ server_lib = static_library('fc_server', executable(server_binary_name, 'server/civserver.c', + servericon, include_directories: server_inc, link_with: [server_lib, common_lib, ais], dependencies: [m_dep, net_dep, readline_dep, gettext_dep], @@ -2435,6 +2454,7 @@ executable('freeciv-gtk3.22', 'client/gui-gtk-3.22/unitselunitdlg.c', 'client/gui-gtk-3.22/voteinfo_bar.c', 'client/gui-gtk-3.22/wldlg.c', + clienticon, c_args: [ '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_20', '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_22', '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_50', @@ -2530,7 +2550,7 @@ executable('freeciv-qt', 'client/gui-qt/voteinfo_bar.cpp', 'client/gui-qt/wldlg.cpp', 'client/gui_interface.c', - mocced_client, + mocced_client, clienticon, include_directories: [client_inc, include_directories('client/gui-qt')], dependencies: [qt5_dep, net_dep, gettext_dep], link_with: client_common, @@ -2738,6 +2758,7 @@ executable('freeciv-sdl2', 'client/gui-sdl2/widget_scrollbar.c', 'client/gui-sdl2/widget_window.c', 'client/gui-sdl2/wldlg.c', + clienticon, include_directories: client_inc, dependencies: [c_compiler.find_library('libSDL2', dirs: cross_lib_path), c_compiler.find_library('libSDL2_mixer', dirs: cross_lib_path), @@ -2810,6 +2831,7 @@ endif executable('freeciv-mp-gtk3', 'tools/fcmp/mpgui_gtk3.c', + mpicon, c_args: [ '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_20', '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_22', '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_50', @@ -2831,6 +2853,7 @@ endif executable('freeciv-mp-gtk4', 'tools/fcmp/mpgui_gtk4.c', + mpicon, c_args: [ '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_0', '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_0', '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_66', @@ -2858,7 +2881,7 @@ mocced_fcmp = qt5_mod.preprocess( executable('freeciv-mp-qt', 'tools/fcmp/mpgui_qt.cpp', 'tools/fcmp/mpgui_qt_worker.cpp', - mocced_fcmp, + mocced_fcmp, mpicon, include_directories: tool_inc, dependencies: [qt5_dep, sqlite3_dep, gettext_dep], link_with: [common_lib, fcmp_common], @@ -2871,6 +2894,7 @@ if get_option('fcmp').contains('cli') executable('freeciv-mp-cli', 'tools/fcmp/mpcli.c', + mpicon, include_directories: tool_inc, dependencies: [sqlite3_dep, gettext_dep], link_with: [common_lib, fcmp_common], @@ -2946,7 +2970,7 @@ executable('freeciv-ruledit', 'tools/ruledit/tab_unit.cpp', 'tools/ruledit/univ_value.c', 'tools/ruledit/validity.c', - mocced_ruledit, + mocced_ruledit, rulediticon, include_directories: tool_inc, dependencies: [qt5_dep, m_dep, net_dep, readline_dep, gettext_dep], link_with: [common_lib, server_lib, ais, tool_lib], -- 2.34.1