Skip to content

Commit

Permalink
build: add compiler information to gamescope_version
Browse files Browse the repository at this point in the history
Seems helpful for diagnosing issues that comes up in one build that may
not be present in the same build with a different compiler.
  • Loading branch information
matte-schwartz authored and misyltoad committed Sep 7, 2024
1 parent 7bc3c67 commit dfd8479
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,22 @@ foreach feat : required_wlroots_features
endif
endforeach

gamescope_version = vcs_tag(
command : ['git', 'describe', '--always', '--tags', '--dirty=+'],
input : 'GamescopeVersion.h.in',
output : 'GamescopeVersion.h')
cc = meson.get_compiler('c')
compiler_name = cc.get_id()
compiler_version = cc.version()

vcs_tag_cmd = ['git', 'describe', '--always', '--tags', '--dirty=+']
vcs_tag = run_command(vcs_tag_cmd).stdout().strip()
version_tag = vcs_tag + ' (' + compiler_name + ' ' + compiler_version + ')'

gamescope_version_conf = configuration_data()
gamescope_version_conf.set('VCS_TAG', version_tag)

gamescope_version = configure_file(
input : 'GamescopeVersion.h.in',
output : 'GamescopeVersion.h',
configuration : gamescope_version_conf
)

executable(
'gamescope',
Expand Down

0 comments on commit dfd8479

Please sign in to comment.