Skip to content

Commit

Permalink
Meson: Generate specenum headers
Browse files Browse the repository at this point in the history
See osdn #48703

Partially contributed by Marko Lindqvist

Signed-off-by: Alina Lenk <[email protected]>
  • Loading branch information
alien-valkyrie committed Oct 7, 2023
1 parent c4121e0 commit aea54a6
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ common_inc = include_directories(cross_inc_path,
lua_inc_path, 'dependencies/luasql/src', 'dependencies/tinycthread',
'dependencies/tolua-5.2/include', 'dependencies/cvercmp',
'utility', 'common', 'common/networking', 'common/scriptcore',
'common/aicore', 'gen_headers/enums')
'common/aicore')

server_inc = [common_inc, include_directories('server', 'server/advisors',
'server/scripting', 'server/generator', 'server/savegame',
Expand Down Expand Up @@ -1035,6 +1035,29 @@ specenum = custom_target('specenum_gen.h', output: 'specenum_gen.h',
command: [python_exe, files('utility/generate_specenum.py'),
'@OUTPUT@'])

enum_defs = {
'common': {
'terrain_enums': ['terrain_enums.def', 'terrain_enums_gen.h'],
},
'manual': {
'manual_enums': ['manual_enums.def', 'manual_enums_gen.h'],
}
}

enum_targets = {}
foreach group, defs : enum_defs
tgts = []
foreach name, paths : defs
tgts += custom_target(name,
input: join_paths('gen_headers/enums', paths[0]),
output: paths[1],
command: [python_exe, files('gen_headers/generate_enums.py'),
'@OUTPUT@', '@INPUT@'],
depend_files: files('gen_headers/generate_enums.py'))
endforeach
enum_targets += {group: tgts}
endforeach

pack_common = custom_target('packets_common',
input: files('common/networking/packets.def'),
output: ['packets_gen.h', 'packets_gen.c'],
Expand Down Expand Up @@ -1273,7 +1296,7 @@ common_lib = library('freeciv',
'common/workertask.c',
'common/worklist.c',
include_directories : common_inc,
sources: [specenum, pack_common,
sources: [specenum, enum_targets['common'], pack_common,
tolua_com_a, tolua_com_z, tolua_game, tolua_signal],
link_whole: fc_deps,
dependencies: [zlib_dep,
Expand Down Expand Up @@ -4215,6 +4238,7 @@ executable('freeciv-manual',
'tools/manual/manual_settings.c',
'tools/manual/manual_terrain.c',
'client/helpdata.c',
sources: [enum_targets['manual']],
link_with: [common_lib, server_lib, tool_lib, ais],
include_directories: [tool_inc,
include_directories('client', 'client/include')],
Expand Down

0 comments on commit aea54a6

Please sign in to comment.