1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
project('Pong', 'c', license : 'GPL-3.0-only', version : '0.1', default_options : ['warning_level=3', 'werror=true', 'optimization=g', 'c_std=c11', 'prefix=/opt'])
add_project_link_arguments('../raylib/libraylib.a', '-lm', '-ldl', '-lrt', language : 'c')
fs = import('fs')
message('Cleaning raylib...')
# First clean up
run_command('make', '-C', 'raylib/src', 'clean', capture : true, check : true)
message('Building raylib...')
# Then Build
run_command('make', '-C', 'raylib/src', 'PLATFORM=PLATFORM_DESKTOP', 'RAYLIB_BUILD_MODE=RELEASE', capture : true, check : true)
if fs.exists('raylib/libraylib.a') == true
message('raylib successfully compiled.')
else
error('raylib failed to compile. Check meson-logs to see what went wrong.')
endif
Raylib_Include = include_directories('raylib/src')
# Install launcher if flatpak
if get_option('build_flatpak') == true
install_data('src/launch.sh', install_dir : 'bin')
endif
X11_Dep = dependency('x11')
Threads_Dep = dependency('threads')
GL_Dep = dependency('gl')
Sources = ['src/main.c', 'src/enemy.c', 'src/ball.c', 'src/title.c']
executable('pong', Sources, dependencies : [X11_Dep, Threads_Dep, GL_Dep], install : true, install_dir : 'Pong', include_directories : Raylib_Include)
install_subdir('resources', install_dir : 'Pong')
|