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',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2024-09-17 19:33:25 +00:00
|
|
|
if host_machine.system() == 'darwin'
|
|
|
|
gfx_gl_default_backend = 'GFX_GL_33C'
|
|
|
|
else
|
|
|
|
gfx_gl_default_backend = 'GFX_GL_21'
|
|
|
|
endif
|
|
|
|
|
|
|
|
trx = subproject('libtrx', default_options: {
|
|
|
|
'tr_version': '2',
|
|
|
|
'gfx_gl_default_backend': gfx_gl_default_backend,
|
|
|
|
})
|
2023-09-23 18:20:47 +00:00
|
|
|
c_compiler = meson.get_compiler('c')
|
|
|
|
|
|
|
|
build_opts = [
|
|
|
|
'-Wno-unused',
|
2024-09-21 10:02:59 +00:00
|
|
|
'-Wno-address-of-packed-member',
|
2024-04-13 19:28:12 +00:00
|
|
|
'-DMESON_BUILD',
|
2024-08-19 23:48:34 +00:00
|
|
|
'-fno-omit-frame-pointer',
|
2023-10-06 22:42:56 +00:00
|
|
|
'-ffile-prefix-map=../../src/=',
|
2024-09-06 09:42:20 +00:00
|
|
|
] + trx.get_variable('defines')
|
2024-04-13 19:28:12 +00:00
|
|
|
|
|
|
|
add_project_arguments(build_opts, language: 'c')
|
|
|
|
|
|
|
|
staticdeps = get_option('staticdeps')
|
|
|
|
|
|
|
|
null_dep = dependency('', required: false)
|
2024-04-29 22:44:09 +00:00
|
|
|
dep_trx = trx.get_variable('dep_trx')
|
2024-04-28 16:19:55 +00:00
|
|
|
dep_sdl2 = dependency('SDL2', static: staticdeps)
|
2024-04-13 19:28:12 +00:00
|
|
|
dep_mathlibrary = c_compiler.find_library('m', static: staticdeps, required : false)
|
2023-09-23 18:20:47 +00:00
|
|
|
|
|
|
|
# autogenerated files
|
2024-04-26 17:42:22 +00:00
|
|
|
exe_resources = []
|
|
|
|
dll_resources = []
|
2023-09-23 18:20:47 +00:00
|
|
|
python3 = find_program('python3', required: true)
|
|
|
|
git = find_program('git', required: true)
|
|
|
|
|
|
|
|
init = custom_target(
|
|
|
|
'fake_init',
|
|
|
|
output: ['init.c'],
|
2024-04-13 19:28:12 +00:00
|
|
|
command: [python3, meson.source_root() + '/tools/generate_init', '-o', meson.current_build_dir() / '@OUTPUT0@'],
|
|
|
|
build_always_stale: true,
|
2023-09-23 18:20:47 +00:00
|
|
|
)
|
2024-04-13 19:28:12 +00:00
|
|
|
|
2023-09-23 18:20:47 +00:00
|
|
|
version_rc = custom_target(
|
|
|
|
'fake_version',
|
|
|
|
output: ['version.rc'],
|
2024-04-13 19:28:12 +00:00
|
|
|
command: [python3, meson.source_root() + '/tools/generate_rcfile', '-o', '@OUTPUT0@'],
|
|
|
|
build_always_stale: true,
|
2023-09-23 18:20:47 +00:00
|
|
|
)
|
2024-04-13 19:28:12 +00:00
|
|
|
|
2023-09-23 18:20:47 +00:00
|
|
|
icon_rc = custom_target(
|
|
|
|
'fake_icon',
|
|
|
|
output: ['icon.rc'],
|
2024-04-13 19:28:12 +00:00
|
|
|
command: [python3, meson.source_root() + '/tools/generate_rcfile', '-o', '@OUTPUT0@'],
|
2023-09-23 18:20:47 +00:00
|
|
|
)
|
2024-04-13 19:28:12 +00:00
|
|
|
|
|
|
|
link_args = []
|
|
|
|
|
2023-09-23 18:20:47 +00:00
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
windows = import('windows')
|
2024-04-13 19:28:12 +00:00
|
|
|
|
2024-04-26 17:42:22 +00:00
|
|
|
version_resource = windows.compile_resources(version_rc)
|
|
|
|
icon_resource = windows.compile_resources(icon_rc)
|
|
|
|
exe_resources = [version_resource, icon_resource]
|
|
|
|
dll_resources = [version_resource]
|
2024-04-13 19:28:12 +00:00
|
|
|
|
|
|
|
link_args += ['-static']
|
2023-09-23 18:20:47 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
exe_sources = [
|
|
|
|
'src/main_exe.c',
|
2024-04-26 17:42:22 +00:00
|
|
|
exe_resources,
|
2023-09-23 18:20:47 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
dll_sources = [
|
2024-04-26 21:07:16 +00:00
|
|
|
init,
|
2024-08-24 15:33:20 +00:00
|
|
|
'src/config.c',
|
|
|
|
'src/config_map.c',
|
2024-03-17 20:40:45 +00:00
|
|
|
'src/decomp/decomp.c',
|
2024-09-04 16:02:55 +00:00
|
|
|
'src/decomp/effects.c',
|
2024-08-27 14:01:59 +00:00
|
|
|
'src/decomp/stats.c',
|
2024-05-30 10:36:51 +00:00
|
|
|
'src/game/background.c',
|
2024-09-19 14:25:05 +00:00
|
|
|
'src/game/backpack.c',
|
2024-04-14 19:14:19 +00:00
|
|
|
'src/game/box.c',
|
2023-10-02 09:13:31 +00:00
|
|
|
'src/game/camera.c',
|
2024-05-30 10:36:51 +00:00
|
|
|
'src/game/clock.c',
|
2024-07-17 13:08:18 +00:00
|
|
|
'src/game/collide.c',
|
2024-09-20 22:48:17 +00:00
|
|
|
'src/game/console/common.c',
|
|
|
|
'src/game/console/setup.c',
|
2024-04-14 18:01:26 +00:00
|
|
|
'src/game/creature.c',
|
2024-08-26 20:26:53 +00:00
|
|
|
'src/game/demo.c',
|
2023-11-13 20:57:36 +00:00
|
|
|
'src/game/effects.c',
|
2024-07-24 16:15:05 +00:00
|
|
|
'src/game/game.c',
|
2024-09-03 19:39:16 +00:00
|
|
|
'src/game/game_string.c',
|
2024-08-26 21:33:59 +00:00
|
|
|
'src/game/gameflow.c',
|
2024-09-03 19:39:16 +00:00
|
|
|
'src/game/gameflow/gameflow_new.c',
|
|
|
|
'src/game/gameflow/reader.c',
|
2024-08-23 13:32:18 +00:00
|
|
|
'src/game/gun/gun.c',
|
2024-08-21 20:44:59 +00:00
|
|
|
'src/game/gun/gun_misc.c',
|
2024-08-23 18:52:53 +00:00
|
|
|
'src/game/gun/gun_pistols.c',
|
2024-08-23 22:04:53 +00:00
|
|
|
'src/game/gun/gun_rifle.c',
|
2024-05-30 10:59:17 +00:00
|
|
|
'src/game/hwr.c',
|
2023-11-16 17:11:47 +00:00
|
|
|
'src/game/input.c',
|
2024-09-05 15:14:36 +00:00
|
|
|
'src/game/inventory/backpack.c',
|
2024-09-04 21:41:06 +00:00
|
|
|
'src/game/inventory/common.c',
|
2024-09-05 14:27:02 +00:00
|
|
|
'src/game/inventory/ring.c',
|
2024-09-04 21:41:06 +00:00
|
|
|
'src/game/inventory/vars.c',
|
2023-11-03 21:18:05 +00:00
|
|
|
'src/game/items.c',
|
2024-09-21 10:58:41 +00:00
|
|
|
'src/game/lara/cheat.c',
|
|
|
|
'src/game/lara/col.c',
|
2024-09-17 22:23:38 +00:00
|
|
|
'src/game/lara/common.c',
|
2024-09-21 10:58:41 +00:00
|
|
|
'src/game/lara/control.c',
|
|
|
|
'src/game/lara/draw.c',
|
|
|
|
'src/game/lara/look.c',
|
2024-09-19 12:32:32 +00:00
|
|
|
'src/game/lara/misc.c',
|
2024-09-21 10:58:41 +00:00
|
|
|
'src/game/lara/state.c',
|
2024-08-07 09:06:32 +00:00
|
|
|
'src/game/level.c',
|
2023-11-03 18:58:42 +00:00
|
|
|
'src/game/los.c',
|
2024-08-05 17:22:47 +00:00
|
|
|
'src/game/lot.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',
|
2024-05-01 08:44:37 +00:00
|
|
|
'src/game/music/music_backend_cdaudio.c',
|
2024-05-30 10:59:17 +00:00
|
|
|
'src/game/music/music_backend_files.c',
|
|
|
|
'src/game/music/music_main.c',
|
2024-07-18 11:17:03 +00:00
|
|
|
'src/game/objects/common.c',
|
2024-04-13 21:07:42 +00:00
|
|
|
'src/game/objects/creatures/bird.c',
|
2024-08-21 20:27:16 +00:00
|
|
|
'src/game/objects/creatures/diver.c',
|
2024-09-10 21:00:49 +00:00
|
|
|
'src/game/objects/effects/ember.c',
|
2024-09-10 20:25:52 +00:00
|
|
|
'src/game/objects/effects/flame.c',
|
2024-09-04 20:40:21 +00:00
|
|
|
'src/game/objects/general/body_part.c',
|
2024-07-21 11:00:05 +00:00
|
|
|
'src/game/objects/general/door.c',
|
2024-08-21 22:16:11 +00:00
|
|
|
'src/game/objects/general/final_level_counter.c',
|
2024-09-10 20:42:52 +00:00
|
|
|
'src/game/objects/traps/ember_emitter.c',
|
2024-09-10 21:08:10 +00:00
|
|
|
'src/game/objects/traps/flame_emitter.c',
|
2024-09-02 19:17:17 +00:00
|
|
|
'src/game/objects/vars.c',
|
2024-07-16 07:42:34 +00:00
|
|
|
'src/game/objects/vehicles/boat.c',
|
2024-08-28 20:37:35 +00:00
|
|
|
'src/game/option/option.c',
|
|
|
|
'src/game/option/option_compass.c',
|
|
|
|
'src/game/option/option_controls.c',
|
|
|
|
'src/game/option/option_detail.c',
|
|
|
|
'src/game/option/option_passport.c',
|
|
|
|
'src/game/option/option_sound.c',
|
2023-10-29 10:30:33 +00:00
|
|
|
'src/game/output.c',
|
2023-11-17 09:26:21 +00:00
|
|
|
'src/game/overlay.c',
|
2023-11-16 19:06:45 +00:00
|
|
|
'src/game/random.c',
|
2024-09-02 22:39:55 +00:00
|
|
|
'src/game/requester.c',
|
2024-05-30 10:59:17 +00:00
|
|
|
'src/game/room.c',
|
2024-07-21 11:00:05 +00:00
|
|
|
'src/game/room_draw.c',
|
2024-09-30 14:56:06 +00:00
|
|
|
'src/game/savegame/common.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',
|
2024-09-24 22:32:06 +00:00
|
|
|
'src/game/ui/common.c',
|
2024-09-10 20:42:52 +00:00
|
|
|
'src/game/ui/controllers/controls.c',
|
2024-09-24 12:42:48 +00:00
|
|
|
'src/game/ui/widgets/controls_column.c',
|
|
|
|
'src/game/ui/widgets/controls_dialog.c',
|
|
|
|
'src/game/ui/widgets/controls_input_selector.c',
|
|
|
|
'src/game/ui/widgets/controls_layout_selector.c',
|
|
|
|
'src/game/ui/widgets/label.c',
|
2024-09-24 22:32:06 +00:00
|
|
|
'src/game/ui/widgets/prompt.c',
|
2024-09-24 12:42:48 +00:00
|
|
|
'src/game/ui/widgets/window.c',
|
2024-09-27 21:49:34 +00:00
|
|
|
'src/global/enum_map.c',
|
2024-04-26 21:07:16 +00:00
|
|
|
'src/global/vars.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-26 22:30:59 +00:00
|
|
|
'src/main_dll.c',
|
2023-10-04 19:28:11 +00:00
|
|
|
'src/specific/s_audio_sample.c',
|
2023-10-04 19:08:18 +00:00
|
|
|
'src/specific/s_flagged_string.c',
|
2023-11-16 17:11:47 +00:00
|
|
|
'src/specific/s_input.c',
|
2024-04-26 17:42:22 +00:00
|
|
|
dll_resources,
|
2023-09-23 18:20:47 +00:00
|
|
|
]
|
|
|
|
|
2024-04-29 22:44:09 +00:00
|
|
|
dll_dependencies = [
|
|
|
|
dep_trx,
|
2024-04-28 16:19:55 +00:00
|
|
|
dep_sdl2,
|
2024-04-13 19:28:12 +00:00
|
|
|
dep_mathlibrary,
|
|
|
|
]
|
|
|
|
|
2023-09-23 18:20:47 +00:00
|
|
|
executable(
|
|
|
|
'TR2X',
|
|
|
|
exe_sources,
|
|
|
|
name_prefix: '',
|
|
|
|
include_directories: ['src/'],
|
|
|
|
link_args: link_args,
|
|
|
|
gui_app: true,
|
|
|
|
)
|
2024-04-13 19:28:12 +00:00
|
|
|
|
2023-09-23 18:20:47 +00:00
|
|
|
library(
|
|
|
|
'TR2X',
|
|
|
|
dll_sources,
|
|
|
|
name_prefix: '',
|
2024-07-23 08:26:11 +00:00
|
|
|
include_directories: ['src/'],
|
2024-04-29 22:44:09 +00:00
|
|
|
dependencies: dll_dependencies,
|
2023-09-23 18:20:47 +00:00
|
|
|
link_args: link_args,
|
|
|
|
)
|