Mostly working OSX build options, but it crashes on close with a thread error.
This commit is contained in:
parent
28b900e4ff
commit
e1f9942da3
3 changed files with 54 additions and 24 deletions
|
@ -128,9 +128,11 @@ namespace gui {
|
||||||
std::optional<Point> MainUI::play_move() {
|
std::optional<Point> MainUI::play_move() {
|
||||||
if($camera.play_move($rayview)) {
|
if($camera.play_move($rayview)) {
|
||||||
$needs_render = false;
|
$needs_render = false;
|
||||||
return std::make_optional<Point>({
|
Point pos{
|
||||||
size_t($camera.target_x),
|
size_t($camera.target_x),
|
||||||
size_t($camera.target_y)});
|
size_t($camera.target_y)};
|
||||||
|
return std::make_optional<Point>(pos);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$needs_render = true;
|
$needs_render = true;
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
|
|
70
meson.build
70
meson.build
|
@ -5,19 +5,51 @@ project('raycaster', 'cpp',
|
||||||
'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1',
|
'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1',
|
||||||
])
|
])
|
||||||
|
|
||||||
add_global_link_arguments(
|
|
||||||
'-static-libgcc',
|
|
||||||
'-static-libstdc++',
|
|
||||||
'-static',
|
|
||||||
language: 'cpp',
|
|
||||||
)
|
|
||||||
|
|
||||||
# use this for common options only for our executables
|
# use this for common options only for our executables
|
||||||
cpp_args=[]
|
cpp_args=[]
|
||||||
|
link_args=[]
|
||||||
# these are passed as override_defaults
|
# these are passed as override_defaults
|
||||||
exe_defaults = ['warning_level=2', 'werror=true']
|
exe_defaults = [ 'warning_level=2' ]
|
||||||
|
|
||||||
cc = meson.get_compiler('cpp')
|
cc = meson.get_compiler('cpp')
|
||||||
|
dependencies = []
|
||||||
|
|
||||||
|
if build_machine.system() == 'windows'
|
||||||
|
sfml_main = dependency('sfml_main')
|
||||||
|
opengl32 = cc.find_library('opengl32', required: true)
|
||||||
|
winmm = cc.find_library('winmm', required: true)
|
||||||
|
gdi32 = cc.find_library('gdi32', required: true)
|
||||||
|
|
||||||
|
add_global_link_arguments(
|
||||||
|
'-static-libgcc',
|
||||||
|
'-static-libstdc++',
|
||||||
|
'-static',
|
||||||
|
language: 'cpp',
|
||||||
|
)
|
||||||
|
|
||||||
|
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 = dependency('catch2-with-main')
|
catch2 = dependency('catch2-with-main')
|
||||||
fmt = subproject('fmt').get_variable('fmt_dep')
|
fmt = subproject('fmt').get_variable('fmt_dep')
|
||||||
|
@ -33,12 +65,14 @@ sfml_audio = dependency('sfml_audio')
|
||||||
sfml_graphics = dependency('sfml_graphics')
|
sfml_graphics = dependency('sfml_graphics')
|
||||||
sfml_network = dependency('sfml_network')
|
sfml_network = dependency('sfml_network')
|
||||||
sfml_system = dependency('sfml_system')
|
sfml_system = dependency('sfml_system')
|
||||||
sfml_window = dependency('sfml_window')
|
sfml_window = dependency('sfml_window',
|
||||||
|
default_options: ['default_library=shared'])
|
||||||
|
|
||||||
ftxui_screen = dependency('ftxui-screen')
|
ftxui_screen = dependency('ftxui-screen')
|
||||||
ftxui_dom = dependency('ftxui-dom')
|
ftxui_dom = dependency('ftxui-dom')
|
||||||
ftxui_component = dependency('ftxui-component')
|
ftxui_component = dependency('ftxui-component')
|
||||||
|
|
||||||
dependencies = [
|
dependencies += [
|
||||||
fmt, json, freetype2,
|
fmt, json, freetype2,
|
||||||
flac, ogg, vorbis, vorbisfile, vorbisenc,
|
flac, ogg, vorbis, vorbisfile, vorbisenc,
|
||||||
sfml_audio, sfml_graphics,
|
sfml_audio, sfml_graphics,
|
||||||
|
@ -46,16 +80,6 @@ dependencies = [
|
||||||
sfml_window, ftxui_screen, ftxui_dom, ftxui_component
|
sfml_window, ftxui_screen, ftxui_dom, ftxui_component
|
||||||
]
|
]
|
||||||
|
|
||||||
if build_machine.system() == 'windows'
|
|
||||||
sfml_main = dependency('sfml_main')
|
|
||||||
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
|
|
||||||
]
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
|
@ -118,12 +142,16 @@ executable('runtests', sources + [
|
||||||
'tests/spatialmap.cpp',
|
'tests/spatialmap.cpp',
|
||||||
'tests/textures.cpp',
|
'tests/textures.cpp',
|
||||||
'tests/tilemap.cpp',
|
'tests/tilemap.cpp',
|
||||||
], override_options: exe_defaults,
|
],
|
||||||
|
cpp_args: cpp_args,
|
||||||
|
link_args: link_args,
|
||||||
|
override_options: exe_defaults,
|
||||||
dependencies: dependencies + [catch2])
|
dependencies: dependencies + [catch2])
|
||||||
|
|
||||||
|
|
||||||
executable('zedcaster',
|
executable('zedcaster',
|
||||||
sources + [ 'main.cpp' ],
|
sources + [ 'main.cpp' ],
|
||||||
cpp_args: cpp_args,
|
cpp_args: cpp_args,
|
||||||
|
link_args: link_args,
|
||||||
override_options: exe_defaults,
|
override_options: exe_defaults,
|
||||||
dependencies: dependencies)
|
dependencies: dependencies)
|
||||||
|
|
|
@ -7,4 +7,4 @@ mv -f packagecache ./subprojects/ && true
|
||||||
mkdir builddir
|
mkdir builddir
|
||||||
cp wraps/*.wrap subprojects/
|
cp wraps/*.wrap subprojects/
|
||||||
# on OSX you can't do this with static
|
# on OSX you can't do this with static
|
||||||
meson setup builddir
|
meson setup --default-library=static --prefer-static builddir
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue