TR2X/meson.build

124 lines
2.7 KiB
Meson
Raw Normal View History

2023-09-23 18:20:47 +00:00
project('TR2X', ['c'],
default_options: [
2023-10-05 09:21:28 +00:00
'c_std=c17',
2023-09-23 18:20:47 +00:00
'warning_level=2',
],
)
warning_level = 3
c_compiler = meson.get_compiler('c')
is_mingw = c_compiler.get_id() == 'gcc' and host_machine.system() == 'windows'
if is_mingw
add_project_link_arguments([], language: 'c')
endif
build_opts = [
'-Wno-unused',
'-D_GNU_SOURCE',
]
2023-10-06 22:42:56 +00:00
c_opts = [
'-ffile-prefix-map=../../src/=',
]
2023-09-23 18:20:47 +00:00
add_project_arguments(build_opts + c_opts, language: 'c')
# autogenerated files
resources = []
python3 = find_program('python3', required: true)
git = find_program('git', required: true)
version = custom_target('version',
output: ['version.txt'],
command: [python3, meson.source_root() + '/tools/generate_version', '-o', '@OUTPUT0@'],
build_by_default: true,
build_always_stale: true
)
init = custom_target(
'fake_init',
depends: [version],
input: [version[0]],
output: ['init.c'],
command: [python3, meson.source_root() + '/tools/generate_init', '--version-file', '@INPUT@', '-o', '@OUTPUT0@'],
build_by_default: true,
)
version_rc = custom_target(
'fake_version',
depends: [version],
input: [version[0]],
output: ['version.rc'],
command: [python3, meson.source_root() + '/tools/generate_rcfile', '--version-file', '@INPUT@', '-o', '@OUTPUT0@'],
build_by_default: true,
)
icon_rc = custom_target(
'fake_icon',
input: [version[0]],
output: ['icon.rc'],
command: [python3, meson.source_root() + '/tools/generate_rcfile', '--version-file', '@INPUT@', '-o', '@OUTPUT0@'],
)
if host_machine.system() == 'windows'
windows = import('windows')
resources = [
windows.compile_resources(version_rc),
windows.compile_resources(icon_rc),
]
link_args = ['-static']
else
link_args = []
endif
exe_sources = [
init,
'src/main_exe.c',
resources,
]
dll_sources = [
'src/filesystem.c',
2023-10-02 09:13:31 +00:00
'src/game/camera.c',
2023-11-13 20:57:36 +00:00
'src/game/effects.c',
2023-11-03 21:18:05 +00:00
'src/game/items.c',
2023-10-06 15:09:28 +00:00
'src/game/lara/lara_col.c',
2023-11-13 22:38:04 +00:00
'src/game/lara/lara_control.c',
2023-11-13 22:09:52 +00:00
'src/game/lara/lara_look.c',
2023-10-07 12:57:05 +00:00
'src/game/lara/lara_misc.c',
2023-10-05 19:07:50 +00:00
'src/game/lara/lara_state.c',
2023-11-03 18:58:42 +00:00
'src/game/los.c',
2023-10-01 16:39:52 +00:00
'src/game/math.c',
2023-10-29 10:08:55 +00:00
'src/game/math_misc.c',
2023-09-26 22:30:59 +00:00
'src/game/matrix.c',
2023-10-05 08:11:38 +00:00
'src/game/music.c',
2023-10-29 10:30:33 +00:00
'src/game/output.c',
2023-10-02 07:45:42 +00:00
'src/game/shell.c',
2023-10-04 19:01:02 +00:00
'src/game/sound.c',
2023-11-03 22:01:22 +00:00
'src/game/text.c',
2023-09-26 22:30:59 +00:00
'src/inject_exec.c',
'src/inject_util.c',
2023-10-05 08:11:38 +00:00
'src/lib/winmm.c',
2023-09-23 18:20:47 +00:00
'src/log.c',
2023-09-26 22:30:59 +00:00
'src/main_dll.c',
2023-09-23 18:20:47 +00:00
'src/memory.c',
2023-10-04 19:28:11 +00:00
'src/specific/s_audio_sample.c',
2023-09-26 22:30:59 +00:00
'src/specific/s_filesystem.c',
2023-10-04 19:08:18 +00:00
'src/specific/s_flagged_string.c',
2023-10-05 09:21:28 +00:00
'src/specific/s_music_mm.c',
'src/specific/s_music_pauld.c',
2023-09-23 18:20:47 +00:00
]
executable(
'TR2X',
exe_sources,
name_prefix: '',
include_directories: ['src/'],
link_args: link_args,
gui_app: true,
)
library(
'TR2X',
dll_sources,
name_prefix: '',
include_directories: ['src/'],
link_args: link_args,
)