Skip to content

Commit

Permalink
Add resources for mingw build
Browse files Browse the repository at this point in the history
Adds an icon and version info.

Signed-off-by: Artem Senichev <[email protected]>
  • Loading branch information
artemsen committed Jan 15, 2024
1 parent 39905bc commit ba8065d
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 6 deletions.
Binary file added extra/pipewalker.ico
Binary file not shown.
29 changes: 23 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand Down
34 changes: 34 additions & 0 deletions src/winres.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: MIT
// Resource file for MS Windows.
// Copyright (C) 2024 Artem Senichev <[email protected]>

#include <windows.h>
#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

0 comments on commit ba8065d

Please sign in to comment.