@ -1,2 +1,3 @@ | |||
*.o | |||
src/build | |||
build | |||
bin_unix/native_* |
@ -0,0 +1,9 @@ | |||
project('octacore', ['cpp'], | |||
version: '0.0.1', | |||
default_options: ['buildtype=debugoptimized', 'cpp_std=c++17'], | |||
meson_version: '>=0.46' | |||
) | |||
bin_path = join_paths(meson.source_root(), 'bin_unix') | |||
subdir('src') |
@ -0,0 +1,72 @@ | |||
client_src = [ | |||
'../shared/crypto.cpp', | |||
'../shared/geom.cpp', | |||
'../shared/glemu.cpp', | |||
'../shared/stream.cpp', | |||
'../shared/tools.cpp', | |||
'../shared/zip.cpp', | |||
'../engine/aa.cpp', | |||
'../engine/bih.cpp', | |||
'../engine/blend.cpp', | |||
'../engine/client.cpp', | |||
'../engine/command.cpp', | |||
'../engine/console.cpp', | |||
'../engine/dynlight.cpp', | |||
'../engine/grass.cpp', | |||
'../engine/light.cpp', | |||
'../engine/main.cpp', | |||
'../engine/material.cpp', | |||
'../engine/menus.cpp', | |||
'../engine/movie.cpp', | |||
'../engine/normal.cpp', | |||
'../engine/octa.cpp', | |||
'../engine/octaedit.cpp', | |||
'../engine/octarender.cpp', | |||
'../engine/physics.cpp', | |||
'../engine/pvs.cpp', | |||
'../engine/rendergl.cpp', | |||
'../engine/renderlights.cpp', | |||
'../engine/rendermodel.cpp', | |||
'../engine/renderparticles.cpp', | |||
'../engine/rendersky.cpp', | |||
'../engine/rendertext.cpp', | |||
'../engine/renderva.cpp', | |||
'../engine/server.cpp', | |||
'../engine/serverbrowser.cpp', | |||
'../engine/shader.cpp', | |||
'../engine/sound.cpp', | |||
'../engine/stain.cpp', | |||
'../engine/texture.cpp', | |||
'../engine/ui.cpp', | |||
'../engine/water.cpp', | |||
'../engine/world.cpp', | |||
'../engine/worldio.cpp', | |||
'../game/ai.cpp', | |||
'../game/client.cpp', | |||
'../game/entities.cpp', | |||
'../game/game.cpp', | |||
'../game/render.cpp', | |||
'../game/scoreboard.cpp', | |||
'../game/server.cpp', | |||
'../game/waypoint.cpp', | |||
'../game/weapon.cpp' | |||
] | |||
threads_dep = dependency('threads') | |||
sdl2_dep = dependency('sdl2') | |||
sdl2_image_dep = dependency('SDL2_image') | |||
sdl2_mixer_dep = dependency('SDL2_mixer') | |||
zlib_dep = dependency('zlib') | |||
gl_dep = dependency('gl') | |||
rt_dep = cc.find_library('rt', required: false) | |||
executable('native_client', | |||
client_src, | |||
dependencies: [ | |||
threads_dep, libenet, sdl2_dep, sdl2_image_dep, | |||
sdl2_mixer_dep, zlib_dep, gl_dep, rt_dep | |||
], | |||
include_directories: octacore_includes, | |||
install: true, | |||
install_dir: join_paths(meson.source_root(), 'bin_unix') | |||
) |
@ -0,0 +1,62 @@ | |||
add_languages('c') | |||
libenet_src = [ | |||
'callbacks.c', | |||
'compress.c', | |||
'host.c', | |||
'list.c', | |||
'packet.c', | |||
'peer.c', | |||
'protocol.c', | |||
'unix.c', | |||
'win32.c' | |||
] | |||
cc = meson.get_compiler('c') | |||
libenet_cflags = [] | |||
if target_machine.system() != 'windows' | |||
if cc.has_function('getaddrinfo', prefix: '#include <netdb.h>') | |||
libenet_cflags += ['-DHAS_GETADDRINFO'] | |||
endif | |||
if cc.has_function('getnameinfo', prefix: '#include <netdb.h>') | |||
libenet_cflags += ['-DHAS_GETNAMEINFO'] | |||
endif | |||
if cc.has_function('gethostbyaddr_r', prefix: '#include <netdb.h>') | |||
libenet_cflags += ['-DHAS_GETHOSTBYADDR_R'] | |||
endif | |||
if cc.has_function('gethostbyname_r', prefix: '#include <netdb.h>') | |||
libenet_cflags += ['-DHAS_GETHOSTBYNAME_R'] | |||
endif | |||
if cc.has_function('poll', prefix: '#include <poll.h>') | |||
libenet_cflags += ['-DHAS_POLL'] | |||
endif | |||
if cc.has_function('fcntl', prefix: '#include <fcntl.h>') | |||
libenet_cflags += ['-DHAS_FCNTL'] | |||
endif | |||
if cc.has_function('inet_pton', prefix: '#include <arpa/inet.h>') | |||
libenet_cflags += ['-DHAS_INET_PTON'] | |||
endif | |||
if cc.has_function('inet_ntop', prefix: '#include <arpa/inet.h>') | |||
libenet_cflags += ['-DHAS_INET_NTOP'] | |||
endif | |||
if cc.has_member('struct msghdr', 'msg_flags', prefix: '#include <sys/socket.h>') | |||
libenet_cflags += ['-DHAS_MSGHDR_FLAGS'] | |||
endif | |||
if cc.has_type('socklen_t', prefix: '#include <sys/socket.h>') | |||
libenet_cflags += ['-DHAS_SOCKLEN_T'] | |||
endif | |||
endif | |||
libenet_lib = static_library('enet', | |||
libenet_src, | |||
include_directories: include_directories('include'), | |||
c_args: libenet_cflags, | |||
install: false | |||
) | |||
libenet = declare_dependency( | |||
include_directories: include_directories('include'), | |||
link_with: libenet_lib | |||
) |
@ -0,0 +1,21 @@ | |||
client_src = [ | |||
'../shared/crypto.cpp', | |||
'../shared/stream.cpp', | |||
'../shared/tools.cpp', | |||
'../engine/command.cpp', | |||
'../engine/master.cpp' | |||
] | |||
threads_dep = dependency('threads') | |||
zlib_dep = dependency('zlib') | |||
executable('native_master', | |||
client_src, | |||
dependencies: [ | |||
threads_dep, libenet, zlib_dep | |||
], | |||
include_directories: octacore_includes, | |||
cpp_args: ['-DSTANDALONE'], | |||
install: true, | |||
install_dir: join_paths(meson.source_root(), 'bin_unix') | |||
) |
@ -0,0 +1,11 @@ | |||
octacore_includes = [ | |||
include_directories('shared', 'engine', 'game', 'enet/include') | |||
] | |||
# FIXME: remove, for now without this the engine behaves wonky | |||
add_global_arguments('-fsigned-char', language: 'cpp') | |||
subdir('enet') | |||
subdir('client') | |||
subdir('server') | |||
subdir('master') |
@ -0,0 +1,24 @@ | |||
client_src = [ | |||
'../shared/crypto.cpp', | |||
'../shared/stream.cpp', | |||
'../shared/tools.cpp', | |||
'../engine/command.cpp', | |||
'../engine/server.cpp', | |||
'../engine/worldio.cpp', | |||
'../game/entities.cpp', | |||
'../game/server.cpp' | |||
] | |||
threads_dep = dependency('threads') | |||
zlib_dep = dependency('zlib') | |||
executable('native_server', | |||
client_src, | |||
dependencies: [ | |||
threads_dep, libenet, zlib_dep | |||
], | |||
include_directories: octacore_includes, | |||
cpp_args: ['-DSTANDALONE'], | |||
install: true, | |||
install_dir: join_paths(meson.source_root(), 'bin_unix') | |||
) |