diff --git a/extra/pipewalker.ico b/extra/pipewalker.ico new file mode 100644 index 0000000..1e2fa54 Binary files /dev/null and b/extra/pipewalker.ico differ diff --git a/meson.build b/meson.build index b7e2047..e996299 100644 --- a/meson.build +++ b/meson.build @@ -66,18 +66,24 @@ endif # configuration file conf = configuration_data() -conf.set_quoted('APP_VERSION', version) -conf.set_quoted('APP_DATADIR', appdata_dir + '/') if get_option('buildtype') == 'release' conf.set('NDEBUG', 1) else conf.set('DEBUG', 1) endif +conf.set_quoted('APP_DATADIR', appdata_dir + '/') +conf.set_quoted('APP_VERSION', version) +if host_machine.system() == 'windows' + vnum = version.split('-')[0].split('.') + assert(vnum.length() == 3, f'Invalid version string: @version@') + conf.set('APP_VERSION_MAJOR', vnum[0].to_int()) + conf.set('APP_VERSION_MINOR', vnum[1].to_int()) + conf.set('APP_VERSION_PATCH', vnum[2].to_int()) +endif configure_file(output: 'buildcfg.h', configuration: conf) -executable( - 'pipewalker', - [ +# source files +sources = [ 'src/cell.cpp', 'src/firework.cpp', 'src/game.cpp', @@ -89,7 +95,18 @@ executable( 'src/skin.cpp', 'src/sound.cpp', 'src/state.cpp', - ], +] +if host_machine.system() == 'windows' + sources += import('windows').compile_resources( + 'src/winres.rc', + include_directories: [meson.current_source_dir() / 'extra', + meson.current_build_dir()] +) +endif + +executable( + 'pipewalker', + sources, dependencies: [ sdl_base, sdl_image, diff --git a/src/winres.rc b/src/winres.rc new file mode 100644 index 0000000..8ebadae --- /dev/null +++ b/src/winres.rc @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +// Resource file for MS Windows. +// Copyright (C) 2024 Artem Senichev + +#include +#include "buildcfg.h" + +0 ICON "pipewalker.ico" +LANGUAGE 0, SUBLANG_NEUTRAL +1 VERSIONINFO + FILEVERSION APP_VERSION_MAJOR,APP_VERSION_MINOR,APP_VERSION_PATCH + PRODUCTVERSION APP_VERSION_MAJOR,APP_VERSION_MINOR,APP_VERSION_PATCH + FILEOS VOS__WINDOWS32 + FILEFLAGSMASK VFT2_UNKNOWN + FILETYPE VFT_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", "PipeWalker game" + VALUE "FileVersion", APP_VERSION + VALUE "InternalName", "PipeWalker" + VALUE "LegalCopyright", "Copyright (C) 2007-2024 Artem Senichev" + VALUE "OriginalFilename", "PipeWalker.exe" + VALUE "ProductName", "PipeWalker game" + VALUE "ProductVersion", APP_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END