mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-20 07:01:27 +02:00
Disable exe icons in mingw ghactions builds
So 1ef0c1a3e0
didn't help at all, great. Either I'm terrible enough at C++ to get the same thing wrong twice, or this is a mingw bug, in which case I'm not willing to waste time trying to figure it out.
This commit is contained in:
3
.github/build.sh
vendored
3
.github/build.sh
vendored
@@ -309,6 +309,9 @@ if [[ $RELEASE_TYPE != dev ]]; then
|
|||||||
fi
|
fi
|
||||||
if [[ "$BSH_HOST_PLATFORM-$BSH_HOST_LIBC" == "windows-mingw" ]]; then
|
if [[ "$BSH_HOST_PLATFORM-$BSH_HOST_LIBC" == "windows-mingw" ]]; then
|
||||||
meson_configure+=$'\t'--cross-file=.github/mingw-ghactions.ini
|
meson_configure+=$'\t'--cross-file=.github/mingw-ghactions.ini
|
||||||
|
# there is some mingw bug that only ever manifests on ghactions which makes MakeIco.exe use tons of memory and fail
|
||||||
|
# TODO: remove this hack once we figure out how to fix that
|
||||||
|
meson_configure+=$'\t'-Dwindows_icons=false
|
||||||
fi
|
fi
|
||||||
if [[ $BSH_DEBUG_RELEASE-$BSH_STATIC_DYNAMIC == release-static ]]; then
|
if [[ $BSH_DEBUG_RELEASE-$BSH_STATIC_DYNAMIC == release-static ]]; then
|
||||||
meson_configure+=$'\t'-Db_lto=true
|
meson_configure+=$'\t'-Db_lto=true
|
||||||
|
@@ -293,3 +293,9 @@ option(
|
|||||||
value: 'auto',
|
value: 'auto',
|
||||||
description: 'Show blue error screen upon unhandled signals and exceptions'
|
description: 'Show blue error screen upon unhandled signals and exceptions'
|
||||||
)
|
)
|
||||||
|
option(
|
||||||
|
'windows_icons',
|
||||||
|
type: 'boolean',
|
||||||
|
value: true,
|
||||||
|
description: 'Add icon resources to the executable on Windows'
|
||||||
|
)
|
||||||
|
@@ -32,42 +32,52 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if host_platform == 'windows'
|
if host_platform == 'windows'
|
||||||
make_ico = executable('makeico', sources: 'MakeIco.cpp', native: true)
|
windows_icons = get_option('windows_icons')
|
||||||
generated_win_icos = {}
|
rc_conf_depends = []
|
||||||
win_icos = {
|
icon_exe_ico_path = ''
|
||||||
'icon_exe': [ 'icon_exe', 'icon_exe_48', 'icon_exe_32', 'icon_exe_16' ],
|
icon_cps_ico_path = ''
|
||||||
'icon_cps': [ 'icon_cps', 'icon_cps_48', 'icon_cps_32', 'icon_cps_16' ],
|
if windows_icons
|
||||||
}
|
make_ico = executable('makeico', sources: 'MakeIco.cpp', native: true)
|
||||||
foreach key, icons : win_icos
|
generated_win_icos = {}
|
||||||
command = [
|
win_icos = {
|
||||||
make_ico,
|
'icon_exe': [ 'icon_exe', 'icon_exe_48', 'icon_exe_32', 'icon_exe_16' ],
|
||||||
'@OUTPUT@',
|
'icon_cps': [ 'icon_cps', 'icon_cps_48', 'icon_cps_32', 'icon_cps_16' ],
|
||||||
]
|
}
|
||||||
foreach ikey : icons
|
foreach key, icons : win_icos
|
||||||
command += [ rendered_icons[ikey] ]
|
command = [
|
||||||
|
make_ico,
|
||||||
|
'@OUTPUT@',
|
||||||
|
]
|
||||||
|
foreach ikey : icons
|
||||||
|
command += [ rendered_icons[ikey] ]
|
||||||
|
endforeach
|
||||||
|
generated_win_icos += { key: custom_target(
|
||||||
|
key + '-ico',
|
||||||
|
output: key + '.ico',
|
||||||
|
command: command,
|
||||||
|
) }
|
||||||
endforeach
|
endforeach
|
||||||
generated_win_icos += { key: custom_target(
|
rc_conf_depends += [
|
||||||
key + '-ico',
|
generated_win_icos['icon_exe'],
|
||||||
output: key + '.ico',
|
generated_win_icos['icon_cps'],
|
||||||
command: command,
|
]
|
||||||
) }
|
icon_exe_ico_path = join_paths(meson.current_build_dir(), 'icon_exe.ico')
|
||||||
endforeach
|
icon_cps_ico_path = join_paths(meson.current_build_dir(), 'icon_cps.ico')
|
||||||
|
endif
|
||||||
rc_conf_data = configuration_data()
|
rc_conf_data = configuration_data()
|
||||||
rc_conf_data.merge_from(conf_data)
|
rc_conf_data.merge_from(conf_data)
|
||||||
|
rc_conf_data.set('HAVE_ICONS', windows_icons ? 1 : 0)
|
||||||
rc_conf_data.set('RESOUCE_H', join_paths(meson.current_source_dir(), 'resource.h'))
|
rc_conf_data.set('RESOUCE_H', join_paths(meson.current_source_dir(), 'resource.h'))
|
||||||
rc_conf_data.set('WINUTF8_XML', join_paths(meson.current_source_dir(), 'winutf8.xml'))
|
rc_conf_data.set('WINUTF8_XML', join_paths(meson.current_source_dir(), 'winutf8.xml'))
|
||||||
rc_conf_data.set('ICON_EXE_ICO', join_paths(meson.current_build_dir(), 'icon_exe.ico'))
|
rc_conf_data.set('ICON_EXE_ICO', icon_exe_ico_path)
|
||||||
rc_conf_data.set('ICON_CPS_ICO', join_paths(meson.current_build_dir(), 'icon_cps.ico'))
|
rc_conf_data.set('ICON_CPS_ICO', icon_cps_ico_path)
|
||||||
powder_files += windows_mod.compile_resources(
|
powder_files += windows_mod.compile_resources(
|
||||||
configure_file(
|
configure_file(
|
||||||
input: 'powder-res.template.rc',
|
input: 'powder-res.template.rc',
|
||||||
output: 'powder-res.rc',
|
output: 'powder-res.rc',
|
||||||
configuration: rc_conf_data,
|
configuration: rc_conf_data,
|
||||||
),
|
),
|
||||||
depends: [
|
depends: rc_conf_depends,
|
||||||
generated_win_icos['icon_exe'],
|
|
||||||
generated_win_icos['icon_cps'],
|
|
||||||
],
|
|
||||||
depend_files: [
|
depend_files: [
|
||||||
'resource.h',
|
'resource.h',
|
||||||
'winutf8.xml',
|
'winutf8.xml',
|
||||||
|
@@ -5,8 +5,11 @@
|
|||||||
#include <winver.h>
|
#include <winver.h>
|
||||||
#include <ntdef.h>
|
#include <ntdef.h>
|
||||||
|
|
||||||
|
#define HAVE_ICONS @HAVE_ICONS@
|
||||||
|
#if HAVE_ICONS
|
||||||
IDI_ICON ICON DISCARDABLE "@ICON_EXE_ICO@"
|
IDI_ICON ICON DISCARDABLE "@ICON_EXE_ICO@"
|
||||||
IDI_DOC_ICON ICON DISCARDABLE "@ICON_CPS_ICO@"
|
IDI_DOC_ICON ICON DISCARDABLE "@ICON_CPS_ICO@"
|
||||||
|
#endif
|
||||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "@WINUTF8_XML@"
|
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "@WINUTF8_XML@"
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
Reference in New Issue
Block a user