Skip to content

Commit

Permalink
Conditionally include gitversion.h
Browse files Browse the repository at this point in the history
  • Loading branch information
andy5995 committed Feb 20, 2025
1 parent 2d9877d commit 9d480e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ gitver = configuration_data()
gitver.set_quoted('GITVERSION', git_version.stdout().strip())
gitversion_h = configure_file(output: 'gitversion.h', configuration: gitver)

# Macros can be written to config.h (see below) using conf.set()
# Macros will be written to config.h later when configure_file() runs
conf = configuration_data()
conf.set('MESON_BUILD', 1)

subdir('source')

Expand Down
4 changes: 4 additions & 0 deletions source/glest_game/facilities/game_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
// License, or (at your option) any later version
// ==============================================================

// This condition can be removed after the cmake build is deprecated
#ifdef MESON_BUILD
#include "gitversion.h"
#endif

#include "game_util.h"

#include "util.h"
Expand Down

0 comments on commit 9d480e3

Please sign in to comment.