First cut of pulling out the relevant parts of my original game to make a little framework.
This commit is contained in:
commit
6a0c9e8d46
177 changed files with 18197 additions and 0 deletions
142
meson.build
Normal file
142
meson.build
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
|
||||
project('raycaster', 'cpp',
|
||||
version: '0.1.0',
|
||||
default_options: [
|
||||
'cpp_std=c++23',
|
||||
'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1',
|
||||
])
|
||||
|
||||
# use this for common options only for our executables
|
||||
cpp_args=[
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-unused-function',
|
||||
'-Wno-unused-variable',
|
||||
'-Wno-unused-but-set-variable',
|
||||
'-Wno-deprecated-declarations',
|
||||
]
|
||||
link_args=[]
|
||||
# these are passed as override_defaults
|
||||
exe_defaults = [ 'warning_level=2' ]
|
||||
|
||||
cc = meson.get_compiler('cpp')
|
||||
dependencies = []
|
||||
|
||||
if build_machine.system() == 'windows'
|
||||
add_global_link_arguments(
|
||||
'-static-libgcc',
|
||||
'-static-libstdc++',
|
||||
'-static',
|
||||
'-flto',
|
||||
language: 'cpp',
|
||||
)
|
||||
|
||||
sfml_main = subproject('sfml').get_variable('sfml_main_dep')
|
||||
opengl32 = cc.find_library('opengl32', required: true)
|
||||
winmm = cc.find_library('winmm', required: true)
|
||||
gdi32 = cc.find_library('gdi32', required: true)
|
||||
|
||||
dependencies += [
|
||||
opengl32, winmm, gdi32, sfml_main
|
||||
]
|
||||
exe_defaults += ['werror=true']
|
||||
|
||||
elif build_machine.system() == 'darwin'
|
||||
add_global_link_arguments(
|
||||
language: 'cpp',
|
||||
)
|
||||
|
||||
opengl = dependency('OpenGL')
|
||||
corefoundation = dependency('CoreFoundation')
|
||||
carbon = dependency('Carbon')
|
||||
cocoa = dependency('Cocoa')
|
||||
iokit = dependency('IOKit')
|
||||
corevideo = dependency('CoreVideo')
|
||||
|
||||
link_args += ['-ObjC']
|
||||
exe_defaults += ['werror=false']
|
||||
dependencies += [
|
||||
opengl, corefoundation, carbon, cocoa, iokit, corevideo
|
||||
]
|
||||
endif
|
||||
|
||||
catch2 = subproject('catch2').get_variable('catch2_with_main_dep')
|
||||
fmt = subproject('fmt').get_variable('fmt_dep')
|
||||
json = subproject('nlohmann_json').get_variable('nlohmann_json_dep')
|
||||
freetype2 = subproject('freetype2').get_variable('freetype_dep')
|
||||
|
||||
flac = subproject('flac').get_variable('flac_dep')
|
||||
ogg = subproject('ogg').get_variable('libogg_dep')
|
||||
vorbis = subproject('vorbis').get_variable('vorbis_dep')
|
||||
vorbisfile = subproject('vorbis').get_variable('vorbisfile_dep')
|
||||
vorbisenc = subproject('vorbis').get_variable('vorbisenc_dep')
|
||||
sfml_audio = subproject('sfml').get_variable('sfml_audio_dep')
|
||||
sfml_graphics = subproject('sfml').get_variable('sfml_graphics_dep')
|
||||
sfml_network = subproject('sfml').get_variable('sfml_network_dep')
|
||||
sfml_system = subproject('sfml').get_variable('sfml_system_dep')
|
||||
sfml_window = subproject('sfml').get_variable('sfml_window_dep')
|
||||
lel_guecs = subproject('lel-guecs').get_variable('lel_guecs_dep')
|
||||
|
||||
inc_dirs = include_directories('src')
|
||||
|
||||
subdir('src')
|
||||
subdir('tests')
|
||||
|
||||
dependencies += [
|
||||
fmt, json, freetype2,
|
||||
flac, ogg, vorbis, vorbisfile, vorbisenc,
|
||||
sfml_audio, sfml_graphics,
|
||||
sfml_network, sfml_system,
|
||||
sfml_window, lel_guecs
|
||||
]
|
||||
|
||||
caster_lib = static_library('caster',
|
||||
sources,
|
||||
cpp_args: cpp_args,
|
||||
include_directories: inc_dirs,
|
||||
override_options: exe_defaults,
|
||||
dependencies: dependencies)
|
||||
|
||||
caster_dep = declare_dependency(
|
||||
link_with: caster_lib,
|
||||
include_directories: inc_dirs)
|
||||
|
||||
dependencies += [ caster_dep ]
|
||||
|
||||
executable('runtests', sources + tests,
|
||||
cpp_args: cpp_args,
|
||||
link_args: link_args,
|
||||
include_directories: inc_dirs,
|
||||
override_options: exe_defaults,
|
||||
dependencies: dependencies + [catch2])
|
||||
|
||||
executable('zedcaster',
|
||||
[ 'src/main.cpp' ],
|
||||
cpp_args: cpp_args,
|
||||
link_args: link_args,
|
||||
include_directories: inc_dirs,
|
||||
override_options: exe_defaults,
|
||||
dependencies: dependencies)
|
||||
|
||||
executable('animator',
|
||||
[ 'tools/animator.cpp' ],
|
||||
cpp_args: cpp_args,
|
||||
link_args: link_args,
|
||||
include_directories: inc_dirs,
|
||||
override_options: exe_defaults,
|
||||
dependencies: dependencies)
|
||||
|
||||
executable('icongen',
|
||||
[ 'tools/icongen.cpp' ],
|
||||
cpp_args: cpp_args,
|
||||
link_args: link_args,
|
||||
include_directories: inc_dirs,
|
||||
override_options: exe_defaults,
|
||||
dependencies: dependencies)
|
||||
|
||||
executable('fragviewer',
|
||||
[ 'tools/fragviewer.cpp' ],
|
||||
cpp_args: cpp_args,
|
||||
link_args: link_args,
|
||||
include_directories: inc_dirs,
|
||||
override_options: exe_defaults,
|
||||
dependencies: dependencies)
|
||||
Loading…
Add table
Add a link
Reference in a new issue