2020-12-14 04:14:08 +01:00
|
|
|
project('dosbox-staging', 'c', 'cpp',
|
2021-07-02 11:36:34 -07:00
|
|
|
version : '0.78.0',
|
2021-02-16 01:47:15 +01:00
|
|
|
license : 'GPL-2.0-or-later',
|
2021-10-04 14:32:08 +02:00
|
|
|
meson_version : '>= 0.54.2',
|
|
|
|
default_options : [
|
|
|
|
'cpp_std=c++17',
|
|
|
|
'warning_level=3',
|
|
|
|
'b_ndebug=if-release',
|
|
|
|
'b_staticpic=false',
|
2021-10-21 15:45:47 -07:00
|
|
|
'mt32emu:warning_level=0',
|
|
|
|
'fluidsynth:warning_level=0',
|
2021-10-26 18:45:09 -07:00
|
|
|
'gtest:warning_level=0',
|
2021-10-04 14:32:08 +02:00
|
|
|
])
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2021-02-06 18:06:49 +01:00
|
|
|
# After increasing the minimum-required meson version, make the following
|
|
|
|
# improvements:
|
|
|
|
#
|
2021-02-09 13:42:30 +01:00
|
|
|
# - 0.55.0 - subproject wraps are automatically promoted to fallbacks,
|
|
|
|
# stop using: "fallback : ['foo', 'foo_dep']" for dependencies
|
2021-02-06 18:06:49 +01:00
|
|
|
# - 0.56.0 - use meson.current_source_dir() in unit tests
|
2020-12-14 04:14:08 +01:00
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
cxx = meson.get_compiler('cpp')
|
|
|
|
|
2021-10-03 22:29:24 +02:00
|
|
|
summary('Build type', get_option('buildtype'), section : 'Build Summary')
|
|
|
|
summary('Install prefix', get_option('prefix'), section : 'Build Summary')
|
|
|
|
|
|
|
|
|
|
|
|
# compiler flags
|
|
|
|
#
|
2021-11-02 13:17:37 -07:00
|
|
|
foreach cxx_warning : ['-Wmaybe-uninitialized', '-Weffc++', '-Wextra-semi']
|
|
|
|
if cxx.has_argument(cxx_warning)
|
|
|
|
add_project_arguments(cxx_warning, language : 'cpp')
|
|
|
|
endif
|
|
|
|
endforeach
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2020-12-20 11:38:00 +01:00
|
|
|
# gather data for config file
|
2020-12-14 04:14:08 +01:00
|
|
|
#
|
2021-01-12 20:45:49 +01:00
|
|
|
# Actual config.h file will be generated after all interpreting build files
|
|
|
|
# for all subdirs.
|
|
|
|
#
|
2020-12-14 04:14:08 +01:00
|
|
|
conf_data = configuration_data()
|
|
|
|
conf_data.set('version', meson.project_version())
|
2021-01-04 23:54:37 +01:00
|
|
|
|
2021-03-07 00:44:57 +01:00
|
|
|
if get_option('buildtype').startswith('debug')
|
2021-03-10 11:45:12 +01:00
|
|
|
conf_data.set('conf_suffix', '-staging-git')
|
2021-03-07 00:44:57 +01:00
|
|
|
else
|
2021-03-10 11:45:12 +01:00
|
|
|
conf_data.set('conf_suffix', '-staging')
|
2021-03-07 00:44:57 +01:00
|
|
|
endif
|
|
|
|
|
2021-02-07 22:17:05 +01:00
|
|
|
os_family_name = {
|
|
|
|
'linux' : 'LINUX',
|
|
|
|
'windows' : 'WIN32',
|
|
|
|
'cygwin' : 'WIN32',
|
|
|
|
'darwin' : 'MACOSX',
|
|
|
|
'freebsd' : 'BSD',
|
|
|
|
'netbsd' : 'BSD',
|
|
|
|
'openbsd' : 'BSD',
|
|
|
|
'dragonfly' : 'BSD',
|
|
|
|
}.get(host_machine.system(), 'UNKNOWN_OS')
|
|
|
|
conf_data.set(os_family_name, 1)
|
2021-01-04 23:54:37 +01:00
|
|
|
|
2020-12-14 04:14:08 +01:00
|
|
|
conf_data.set10('C_MODEM', get_option('use_sdl2_net'))
|
|
|
|
conf_data.set10('C_IPX', get_option('use_sdl2_net'))
|
2021-02-24 15:00:10 +01:00
|
|
|
conf_data.set10('C_NE2000', get_option('use_slirp') or get_option('use_pcap'))
|
2020-12-14 04:14:08 +01:00
|
|
|
conf_data.set10('C_OPENGL', get_option('use_opengl'))
|
|
|
|
conf_data.set10('C_FLUIDSYNTH', get_option('use_fluidsynth'))
|
2021-02-09 13:42:30 +01:00
|
|
|
conf_data.set10('C_MT32EMU', get_option('use_mt32emu'))
|
2020-12-14 04:14:08 +01:00
|
|
|
conf_data.set10('C_SSHOT', get_option('use_png'))
|
2021-01-12 20:45:49 +01:00
|
|
|
conf_data.set10('C_FPU', true)
|
2021-02-06 18:58:02 +01:00
|
|
|
conf_data.set10('C_FPU_X86', host_machine.cpu_family() in ['x86', 'x86_64'])
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2021-01-14 21:53:42 +01:00
|
|
|
if get_option('enable_debugger') != 'none'
|
|
|
|
conf_data.set10('C_DEBUG', true)
|
2020-12-14 04:14:08 +01:00
|
|
|
endif
|
|
|
|
|
2021-01-14 21:53:42 +01:00
|
|
|
if get_option('enable_debugger') == 'heavy'
|
|
|
|
conf_data.set10('C_HEAVY_DEBUG', true)
|
2021-01-12 22:14:51 +01:00
|
|
|
endif
|
|
|
|
|
2021-01-21 16:18:40 +01:00
|
|
|
foreach osdef : ['LINUX', 'WIN32', 'MACOSX', 'BSD']
|
|
|
|
if conf_data.has(osdef)
|
|
|
|
conf_data.set10('C_DIRECTSERIAL', true)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2021-01-14 21:53:42 +01:00
|
|
|
if cc.has_function('clock_gettime', prefix : '#include <time.h>')
|
|
|
|
conf_data.set10('HAVE_CLOCK_GETTIME', true)
|
2020-12-14 04:14:08 +01:00
|
|
|
endif
|
|
|
|
|
2021-06-01 09:02:39 -05:00
|
|
|
if cc.has_function('__builtin_available')
|
|
|
|
conf_data.set10('HAVE_BUILTIN_AVAILABLE', true)
|
|
|
|
endif
|
|
|
|
|
2021-08-16 12:23:27 -05:00
|
|
|
if cc.has_function('__builtin___clear_cache')
|
|
|
|
conf_data.set10('HAVE_BUILTIN_CLEAR_CACHE', true)
|
|
|
|
endif
|
|
|
|
|
2021-01-14 21:53:42 +01:00
|
|
|
if cc.has_function('mprotect', prefix : '#include <sys/mman.h>')
|
|
|
|
conf_data.set10('HAVE_MPROTECT', true)
|
2020-12-17 07:15:53 +01:00
|
|
|
endif
|
|
|
|
|
2021-06-01 09:02:39 -05:00
|
|
|
if cc.has_function('mmap', prefix : '#include <sys/mman.h>')
|
|
|
|
conf_data.set10('HAVE_MMAP', true)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if cc.has_header_symbol('sys/mman.h', 'MAP_JIT')
|
|
|
|
conf_data.set10('HAVE_MAP_JIT', true)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if cc.has_function('pthread_jit_write_protect_np', prefix : '#include <pthread.h>')
|
|
|
|
conf_data.set10('HAVE_PTHREAD_WRITE_PROTECT_NP', true)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if cc.has_function('sys_icache_invalidate', prefix : '#include <libkern/OSCacheControl.h>')
|
|
|
|
conf_data.set10('HAVE_SYS_ICACHE_INVALIDATE', true)
|
|
|
|
endif
|
|
|
|
|
2021-01-03 22:30:19 -08:00
|
|
|
if cxx.has_function('pthread_setname_np', prefix : '#include <pthread.h>',
|
|
|
|
dependencies : dependency('threads'))
|
|
|
|
conf_data.set10('HAVE_PTHREAD_SETNAME_NP', true)
|
|
|
|
endif
|
|
|
|
|
2021-01-04 21:32:03 +01:00
|
|
|
if cc.has_function('realpath', prefix : '#include <stdlib.h>')
|
|
|
|
conf_data.set10('HAVE_REALPATH', true)
|
|
|
|
endif
|
|
|
|
|
2021-01-14 21:53:42 +01:00
|
|
|
if cc.has_member('struct dirent', 'd_type', prefix : '#include <dirent.h>')
|
|
|
|
conf_data.set10('HAVE_STRUCT_DIRENT_D_TYPE', true)
|
2020-12-17 07:15:53 +01:00
|
|
|
endif
|
|
|
|
|
2021-01-14 22:35:18 +01:00
|
|
|
foreach header : ['pwd.h', 'strings.h', 'netinet/in.h', 'sys/socket.h']
|
|
|
|
if cc.has_header(header)
|
|
|
|
conf_data.set('HAVE_' + header.underscorify().to_upper(), 1)
|
|
|
|
endif
|
|
|
|
endforeach
|
2021-01-04 21:57:58 +01:00
|
|
|
|
2021-01-21 16:33:25 +01:00
|
|
|
# Header windows.h defines old min/max macros, that conflict with C++11
|
|
|
|
# std::min/std::max. Defining NOMINMAX prevents these macros from appearing.
|
|
|
|
if cxx.get_id() == 'msvc'
|
|
|
|
conf_data.set('NOMINMAX', true)
|
|
|
|
endif
|
|
|
|
|
2021-02-06 18:58:02 +01:00
|
|
|
if host_machine.system() in ['windows', 'cygwin']
|
2021-01-21 22:49:07 +01:00
|
|
|
conf_data.set('_USE_MATH_DEFINES', true)
|
|
|
|
endif
|
|
|
|
|
2020-12-23 07:51:26 +01:00
|
|
|
if host_machine.endian() == 'big'
|
|
|
|
conf_data.set('WORDS_BIGENDIAN', 1)
|
|
|
|
endif
|
|
|
|
|
2021-01-12 22:00:50 +01:00
|
|
|
# Non-4K memory page size is supported only for ppc64 at the moment.
|
2021-02-16 12:09:11 +01:00
|
|
|
# TODO re-enable ppc dynrec while working on W^X stuff
|
|
|
|
# disabled because SVN r4424 broke compilation of ppc backends
|
|
|
|
#if host_machine.cpu_family() in ['ppc64', 'ppc64le']
|
|
|
|
# conf_data.set('PAGESIZE', 65536)
|
|
|
|
#endif
|
2021-01-12 22:00:50 +01:00
|
|
|
|
2021-01-13 02:04:50 +01:00
|
|
|
set_prio_code = '''
|
|
|
|
#include <sys/resource.h>
|
|
|
|
int main() {
|
|
|
|
return setpriority(PRIO_PROCESS, 0, PRIO_MIN + PRIO_MAX);
|
|
|
|
}
|
|
|
|
'''
|
|
|
|
if cc.compiles(set_prio_code, name : 'test for setpriority support')
|
|
|
|
conf_data.set('HAVE_SETPRIORITY', 1)
|
|
|
|
endif
|
|
|
|
|
2021-01-21 15:49:04 +01:00
|
|
|
# New compilers can check for this feature using __has_builtin, but this is
|
|
|
|
# broken prior to Clang 10 and GCC 10, so we prefer to have this compilation
|
|
|
|
# check for now:
|
|
|
|
builtin_expect_code = '''
|
|
|
|
void fun(bool test) {
|
|
|
|
// value of 'test' is usually going to be true
|
|
|
|
if (__builtin_expect(test, true)) {
|
|
|
|
/* likely branch */
|
|
|
|
} else {
|
|
|
|
/* unlikely branch */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
'''
|
|
|
|
if cxx.compiles(builtin_expect_code, name : 'test for __builtin_expect support')
|
|
|
|
conf_data.set('C_HAS_BUILTIN_EXPECT', 1)
|
|
|
|
endif
|
|
|
|
|
2020-12-14 04:14:08 +01:00
|
|
|
|
|
|
|
# external dependencies
|
|
|
|
#
|
2021-02-20 23:08:19 +01:00
|
|
|
static_libs_list = get_option('try_static_libs')
|
|
|
|
msg = 'You can disable this dependency with: -D@0@=false'
|
|
|
|
|
2021-01-18 22:56:03 +01:00
|
|
|
optional_dep = dependency('', required : false)
|
2021-08-24 12:09:11 -05:00
|
|
|
dl_dep = cc.find_library('dl', required : false)
|
Use an atomic to manager the SoftLimiter's pre-scalar
The pre-scalar:
1. Is read and applied to the samples before limiting in
SoftLimiter
2. Is written-to and updated when the user updates their
channel's mixer level.
These two tasks can occur in separate threads, therefore
a potential data-race exists on the pre-scalar value as
reported by Clang's thread sanitizer:
1. When applying the scalar:
ThreadSanitizer: data race
../src/misc/soft_limiter.cpp:194 in void
SoftLimiter::ScaleOrCopy<(signed
char)0>(std::vector<float, std::allocator<float> > const&,
unsigned short, float, __gnu_cxx::__normal_iterator<float
const*, std::vector<float, std::allocator<float> > >,
__gnu_cxx::__normal_iterator<float const*,
std::vector<float, std::allocator<float> > >, float,
float, std::vector<short, std::allocator<short> >&)
2. When updating the scalar via mixer callback:
ThreadSanitizer: data race ../src/midi/midi_mt32.cpp:362
in MidiHandler_mt32::SetMixerLevel(AudioFrame const&)
2021-03-02 15:54:11 -08:00
|
|
|
atomic_dep = cxx.find_library('atomic', required : false)
|
2021-10-03 21:33:52 -07:00
|
|
|
stdcppfs_dep = cxx.find_library('stdc++fs', required : false)
|
2021-03-05 07:33:42 -08:00
|
|
|
opus_dep = dependency('opusfile',
|
|
|
|
static : ('opusfile' in static_libs_list))
|
2021-01-18 22:56:03 +01:00
|
|
|
threads_dep = dependency('threads')
|
2021-06-30 07:28:41 -07:00
|
|
|
sdl2_dep = dependency('sdl2', version : '>= 2.0.5',
|
2021-02-20 23:08:19 +01:00
|
|
|
static : ('sdl2' in static_libs_list))
|
2021-01-18 22:56:03 +01:00
|
|
|
sdl2_net_dep = optional_dep
|
|
|
|
opengl_dep = optional_dep
|
|
|
|
fluid_dep = optional_dep
|
2021-02-09 13:42:30 +01:00
|
|
|
mt32emu_dep = optional_dep
|
2021-01-18 22:56:03 +01:00
|
|
|
png_dep = optional_dep
|
2021-02-24 15:00:10 +01:00
|
|
|
pcap_dep = optional_dep
|
2021-02-24 02:39:51 +01:00
|
|
|
slirp_dep = optional_dep
|
2021-01-18 22:56:03 +01:00
|
|
|
curses_dep = optional_dep # necessary for debugger builds
|
2021-01-21 13:44:19 +01:00
|
|
|
alsa_dep = optional_dep # Linux-only
|
|
|
|
coreaudio_dep = optional_dep # macOS-only
|
|
|
|
coremidi_dep = optional_dep # macOS-only
|
2021-01-22 01:36:26 +01:00
|
|
|
winsock2_dep = optional_dep # Windows-only
|
|
|
|
winmm_dep = optional_dep # Windows-only
|
2021-01-18 22:56:03 +01:00
|
|
|
|
2020-12-14 04:14:08 +01:00
|
|
|
|
|
|
|
if get_option('use_sdl2_net')
|
2021-02-21 15:06:58 +01:00
|
|
|
sdl2_net_dep = dependency('SDL2_net', version : '>= 2.0.0',
|
2021-02-20 23:08:19 +01:00
|
|
|
static : ('sdl2_net' in static_libs_list),
|
2020-12-14 04:14:08 +01:00
|
|
|
not_found_message : msg.format('use_sdl2_net'))
|
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('use_opengl')
|
|
|
|
opengl_dep = dependency('gl', not_found_message : msg.format('use_opengl'))
|
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('use_fluidsynth')
|
|
|
|
fluid_dep = dependency('fluidsynth', version : '>= 2.0.0',
|
2021-04-04 19:38:03 +02:00
|
|
|
static : ('fluidsynth' in static_libs_list),
|
2021-03-11 14:58:07 +01:00
|
|
|
fallback : ['fluidsynth', 'fluidsynth_dep'],
|
2020-12-14 04:14:08 +01:00
|
|
|
not_found_message : msg.format('use_fluidsynth'))
|
|
|
|
endif
|
|
|
|
|
2021-02-09 13:42:30 +01:00
|
|
|
if get_option('use_mt32emu')
|
2021-04-03 19:55:53 +02:00
|
|
|
mt32emu_dep = dependency('mt32emu', version : '>= 2.5.0',
|
2021-06-27 07:11:35 -07:00
|
|
|
static : ('mt32emu' in static_libs_list),
|
2021-02-09 13:42:30 +01:00
|
|
|
fallback : ['mt32emu', 'mt32emu_dep'],
|
|
|
|
not_found_message : msg.format('use_mt32emu'))
|
|
|
|
endif
|
|
|
|
|
2020-12-14 04:14:08 +01:00
|
|
|
if get_option('use_png')
|
2021-02-20 23:22:15 +01:00
|
|
|
png_dep = dependency('libpng', static : ('png' in static_libs_list),
|
|
|
|
not_found_message : msg.format('use_png'))
|
2020-12-14 04:14:08 +01:00
|
|
|
endif
|
|
|
|
|
2021-02-24 15:00:10 +01:00
|
|
|
if get_option('use_pcap') # disabled by default
|
|
|
|
pcap_dep = dependency('libpcap')
|
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('use_slirp') # disabled by default
|
|
|
|
slirp_dep = dependency('slirp')
|
2021-02-24 02:39:51 +01:00
|
|
|
endif
|
|
|
|
|
2021-01-18 22:56:03 +01:00
|
|
|
if get_option('enable_debugger') != 'none'
|
2021-09-25 14:27:59 +12:00
|
|
|
curses_dep = dependency('curses') # use the new 'curses' for msys2 compatibility
|
2020-12-17 07:15:53 +01:00
|
|
|
endif
|
|
|
|
|
2021-01-18 21:48:12 +01:00
|
|
|
# macOS-only dependencies
|
|
|
|
#
|
|
|
|
if host_machine.system() == 'darwin'
|
2021-11-03 09:41:31 -07:00
|
|
|
|
|
|
|
# ObjectiveC parsing, if possible
|
|
|
|
if cxx.has_argument('-lobjc')
|
|
|
|
add_project_arguments('-lobjc', language : 'cpp')
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Core Audio
|
2021-01-18 21:48:12 +01:00
|
|
|
coreaudio_dep = dependency('appleframeworks',
|
|
|
|
modules : ['CoreAudio', 'AudioUnit', 'AudioToolbox'],
|
|
|
|
required : false)
|
|
|
|
if coreaudio_dep.found()
|
2021-11-03 09:41:31 -07:00
|
|
|
if cxx.check_header('AudioToolbox/AUGraph.h')
|
|
|
|
conf_data.set('C_COREAUDIO', 1)
|
|
|
|
else
|
|
|
|
warning('''Core Audio support disabled: header is unsable''')
|
|
|
|
endif
|
2021-01-18 21:48:12 +01:00
|
|
|
else
|
|
|
|
warning('''Core Audio support disabled: compiler can't detect/use Apple Frameworks''')
|
|
|
|
endif
|
|
|
|
|
2021-11-03 09:41:31 -07:00
|
|
|
# Core MIDI
|
2021-01-18 21:48:12 +01:00
|
|
|
coremidi_dep = dependency('appleframeworks',
|
|
|
|
modules : ['CoreMIDI', 'CoreFoundation'],
|
|
|
|
required : false)
|
|
|
|
if coremidi_dep.found()
|
2021-11-03 09:41:31 -07:00
|
|
|
if cxx.check_header('CoreMIDI/MIDIServices.h')
|
|
|
|
conf_data.set('C_COREMIDI', 1)
|
|
|
|
else
|
|
|
|
warning('''Core Audio support disabled: header is unsable''')
|
|
|
|
endif
|
2021-01-18 21:48:12 +01:00
|
|
|
else
|
|
|
|
warning('''Core MIDI support disabled: compiler can't detect/use Apple Frameworks''')
|
|
|
|
endif
|
2021-06-01 09:02:39 -05:00
|
|
|
|
|
|
|
# Apple Silicon has 16k pages
|
|
|
|
pagesize_cmd = run_command('pagesize')
|
|
|
|
if pagesize_cmd.returncode() != 0
|
|
|
|
error('''error executing pagesize''')
|
|
|
|
else
|
|
|
|
pagesize = pagesize_cmd.stdout().strip().to_int()
|
|
|
|
if pagesize != 4096
|
|
|
|
conf_data.set('PAGESIZE', pagesize)
|
|
|
|
endif
|
|
|
|
endif
|
2021-01-18 21:48:12 +01:00
|
|
|
endif
|
|
|
|
|
2021-01-21 13:44:19 +01:00
|
|
|
# Linux-only dependencies
|
|
|
|
#
|
2021-02-12 16:27:56 +01:00
|
|
|
using_linux = (host_machine.system() == 'linux')
|
|
|
|
force_alsa = (get_option('use_alsa') == 'true')
|
|
|
|
if force_alsa or (using_linux and get_option('use_alsa') == 'auto')
|
2021-01-21 13:44:19 +01:00
|
|
|
alsa_dep = dependency('alsa')
|
|
|
|
conf_data.set('C_ALSA', 1)
|
|
|
|
endif
|
|
|
|
|
2021-01-22 01:36:26 +01:00
|
|
|
# Windows-only dependencies
|
|
|
|
#
|
2021-02-06 18:58:02 +01:00
|
|
|
if host_machine.system() in ['windows', 'cygwin']
|
2021-01-22 01:36:26 +01:00
|
|
|
winsock2_dep = cxx.find_library('ws2_32', required : true)
|
|
|
|
winmm_dep = cxx.find_library('winmm', required : true)
|
|
|
|
endif
|
|
|
|
|
2021-10-03 22:29:24 +02:00
|
|
|
summary('OpenGL support', get_option('use_opengl'))
|
|
|
|
|
|
|
|
|
2020-12-14 04:14:08 +01:00
|
|
|
# include directories
|
|
|
|
#
|
2021-10-04 14:23:26 +02:00
|
|
|
incdir = include_directories('include', '.')
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2021-08-24 12:09:11 -05:00
|
|
|
# bundled dependencies, in dependency-order
|
2020-12-14 04:14:08 +01:00
|
|
|
#
|
2021-08-24 12:09:11 -05:00
|
|
|
subdir('src/libs/loguru')
|
2021-10-04 14:23:26 +02:00
|
|
|
subdir('src/libs/decoders')
|
2020-12-14 04:14:08 +01:00
|
|
|
subdir('src/libs/nuked')
|
|
|
|
subdir('src/libs/ppscale')
|
2021-04-14 15:26:08 -07:00
|
|
|
subdir('src/libs/residfp')
|
2021-10-05 07:27:07 -07:00
|
|
|
subdir('src/libs/whereami')
|
2020-12-14 04:14:08 +01:00
|
|
|
|
|
|
|
# internal libs
|
|
|
|
#
|
|
|
|
internal_deps = []
|
|
|
|
subdir('src/cpu')
|
|
|
|
subdir('src/debug')
|
|
|
|
subdir('src/dos')
|
|
|
|
subdir('src/fpu')
|
|
|
|
subdir('src/gui')
|
|
|
|
subdir('src/hardware')
|
|
|
|
subdir('src/ints')
|
|
|
|
subdir('src/midi')
|
|
|
|
subdir('src/misc')
|
|
|
|
subdir('src/shell')
|
|
|
|
|
|
|
|
|
2021-01-12 20:45:49 +01:00
|
|
|
# generate config.h
|
|
|
|
#
|
|
|
|
configure_file(input : 'src/config.h.in', output : 'config.h',
|
|
|
|
configuration : conf_data)
|
|
|
|
|
|
|
|
|
2020-12-19 00:32:37 +01:00
|
|
|
# tests
|
|
|
|
#
|
2021-02-06 18:58:02 +01:00
|
|
|
# Some tests use relative paths; in meson 0.56.0 this can be replaced
|
|
|
|
# with meson.project_source_root().
|
|
|
|
project_source_root = meson.current_source_dir()
|
|
|
|
subdir('tests')
|
2020-12-19 00:32:37 +01:00
|
|
|
|
|
|
|
|
2020-12-14 04:14:08 +01:00
|
|
|
# dosbox executable
|
|
|
|
#
|
2021-02-13 20:27:48 +01:00
|
|
|
version_file = vcs_tag(input : 'src/version.cpp.in', output : 'version.cpp')
|
2021-09-25 14:52:45 +12:00
|
|
|
dosbox_sources = ['src/main.cpp', 'src/dosbox.cpp', version_file]
|
|
|
|
|
|
|
|
# Add Windows resources file if building on Windows
|
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
winmod = import('windows')
|
|
|
|
res_file = winmod.compile_resources('src/winres.rc')
|
|
|
|
dosbox_sources += res_file
|
|
|
|
endif
|
|
|
|
|
|
|
|
executable('dosbox', dosbox_sources,
|
2021-10-03 21:33:52 -07:00
|
|
|
dependencies : [atomic_dep,
|
|
|
|
stdcppfs_dep,
|
|
|
|
sdl2_dep,
|
|
|
|
threads_dep,
|
|
|
|
libloguru_dep,
|
|
|
|
libwhereami_dep]
|
|
|
|
+ internal_deps,
|
2021-02-04 16:56:23 +01:00
|
|
|
include_directories : incdir,
|
|
|
|
install : true)
|
|
|
|
|
|
|
|
|
|
|
|
# additional files for installation
|
|
|
|
#
|
|
|
|
data_dir = get_option('datadir')
|
|
|
|
licenses_dir = data_dir / 'licenses' / 'dosbox-staging'
|
|
|
|
doc_dir = data_dir / 'doc' / 'dosbox-staging'
|
|
|
|
|
|
|
|
install_man('docs/dosbox.1')
|
|
|
|
install_data('COPYING', install_dir : licenses_dir)
|
|
|
|
install_data('AUTHORS', 'README', 'THANKS', install_dir : doc_dir)
|
|
|
|
|
|
|
|
subdir('contrib/linux')
|
|
|
|
subdir('contrib/icons')
|