2022-08-04 21:46:03 -07:00
|
|
|
project(
|
|
|
|
'dosbox-staging',
|
|
|
|
'c',
|
|
|
|
'cpp',
|
2022-09-18 14:09:09 -07:00
|
|
|
version: '0.80.0',
|
2022-08-05 08:25:58 -07:00
|
|
|
license: 'GPL-3.0-or-later',
|
2022-08-04 21:46:03 -07:00
|
|
|
meson_version: '>= 0.56.0',
|
|
|
|
default_options: [
|
|
|
|
'cpp_std=c++17',
|
|
|
|
'buildtype=release',
|
|
|
|
'default_library=static',
|
|
|
|
'b_ndebug=if-release',
|
|
|
|
'b_staticpic=false',
|
|
|
|
'b_pie=false',
|
2022-08-05 00:49:04 -07:00
|
|
|
'warning_level=3',
|
|
|
|
'glib:b_staticpic=true',
|
|
|
|
'glib:glib_assert=false',
|
|
|
|
'glib:glib_checks=false',
|
|
|
|
'glib:glib_debug=disabled',
|
|
|
|
'glib:libmount=disabled',
|
|
|
|
'glib:libelf=disabled',
|
|
|
|
'glib:nls=disabled',
|
|
|
|
'glib:tests=false',
|
|
|
|
'glib:warning_level=0',
|
|
|
|
'glib:xattr=false',
|
2022-08-04 21:46:03 -07:00
|
|
|
'gtest:warning_level=0',
|
|
|
|
],
|
2021-12-12 10:58:28 -08:00
|
|
|
)
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2022-07-30 06:56:28 -07:00
|
|
|
# Gather internal resource dependencies
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# These are always present regardless of host, compiler, dependencies, or options.
|
2021-02-06 18:06:49 +01:00
|
|
|
#
|
2022-08-04 21:46:03 -07:00
|
|
|
data_dir = get_option('datadir')
|
2022-09-20 22:48:56 -07:00
|
|
|
licenses_dir = data_dir / 'licenses' / meson.project_name()
|
|
|
|
doc_dir = data_dir / 'doc' / meson.project_name()
|
2022-07-30 06:56:28 -07:00
|
|
|
|
|
|
|
install_man('docs/dosbox.1')
|
2022-08-04 21:46:03 -07:00
|
|
|
install_data('COPYING', install_dir: licenses_dir)
|
|
|
|
install_data('AUTHORS', 'README', 'THANKS', install_dir: doc_dir)
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2022-07-30 06:56:28 -07:00
|
|
|
subdir('contrib/linux')
|
|
|
|
subdir('contrib/icons')
|
|
|
|
subdir('contrib/resources')
|
|
|
|
|
|
|
|
# Gather compiler settings
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
#
|
2020-12-14 04:14:08 +01:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
cxx = meson.get_compiler('cpp')
|
2021-12-12 11:27:58 -08:00
|
|
|
prefers_static_libs = (get_option('default_library') == 'static')
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
summary('Build type', get_option('buildtype'), section: 'Build Summary')
|
|
|
|
summary('Install prefix', get_option('prefix'), section: 'Build Summary')
|
2021-10-03 22:29:24 +02:00
|
|
|
|
2022-08-04 14:01:46 -07:00
|
|
|
# extra build flags
|
2022-05-08 07:08:07 -07:00
|
|
|
extra_flags = ['-Wno-unknown-pragmas']
|
2022-08-04 14:01:46 -07:00
|
|
|
extra_link_flags = []
|
2021-12-30 09:30:34 -08:00
|
|
|
|
|
|
|
# If the compiler provides std::filesystem, then we consider it modern enough
|
|
|
|
# that we can trust it's extra helpful warnings to let us improve the code quality.
|
|
|
|
if cxx.has_header('filesystem')
|
2022-08-04 21:46:03 -07:00
|
|
|
extra_flags += ['-Wmaybe-uninitialized', '-Weffc++', '-Wextra-semi']
|
2021-12-30 09:30:34 -08:00
|
|
|
else
|
2022-08-04 21:46:03 -07:00
|
|
|
# Otherwise, it's an old compiler and we're just trying to build, and don't
|
|
|
|
# care about fixing their warnings (some generate warnings from their own STL).
|
|
|
|
warning(
|
|
|
|
'Compiler lacks the C++17 std::filesystem - try to upgrade your compiler!',
|
|
|
|
)
|
2021-12-30 09:30:34 -08:00
|
|
|
endif
|
|
|
|
|
2022-06-07 13:47:53 -07:00
|
|
|
if get_option('buildtype') == 'release'
|
2022-08-04 21:46:03 -07:00
|
|
|
# For release builds, we're not anticipating needing
|
|
|
|
# to divide by zero and NaNs, and get FPU signals.
|
|
|
|
# These safety measures are still enabled in debug builds,
|
|
|
|
# so if an issue is reported where these happen help, then
|
|
|
|
# testing with debug builds will make use of them.
|
|
|
|
#
|
|
|
|
extra_flags += [
|
|
|
|
'-fno-math-errno',
|
|
|
|
'-fno-signed-zeros',
|
|
|
|
'-fno-trapping-math',
|
|
|
|
'-fassociative-math',
|
|
|
|
'-freciprocal-math',
|
|
|
|
'-ffinite-math-only',
|
|
|
|
'-frename-registers',
|
|
|
|
'-ffunction-sections',
|
|
|
|
'-fdata-sections',
|
|
|
|
]
|
2022-06-07 13:47:53 -07:00
|
|
|
endif
|
|
|
|
|
2022-06-13 17:30:07 -07:00
|
|
|
if get_option('asm')
|
2022-08-04 21:46:03 -07:00
|
|
|
extra_flags += ['--save-temps', '/FAs']
|
2022-06-13 17:30:07 -07:00
|
|
|
endif
|
|
|
|
|
2021-12-12 15:37:44 +13:00
|
|
|
if host_machine.system() == 'windows'
|
2022-08-04 21:46:03 -07:00
|
|
|
extra_flags += '-Wno-pedantic-ms-format'
|
2021-12-12 15:37:44 +13:00
|
|
|
endif
|
2022-08-04 14:01:46 -07:00
|
|
|
|
2021-12-12 11:27:58 -08:00
|
|
|
if prefers_static_libs
|
2022-08-04 21:46:03 -07:00
|
|
|
extra_flags += ['-static-libstdc++', '-static-libgcc']
|
2022-08-28 22:58:47 -07:00
|
|
|
if host_machine.system() != 'darwin'
|
|
|
|
extra_link_flags += ['-no-pie']
|
|
|
|
endif
|
2021-12-12 11:27:58 -08:00
|
|
|
else
|
2022-08-04 21:46:03 -07:00
|
|
|
extra_flags += ['-shared-libstdc++', '-shared-libgcc', '-fPIC']
|
2021-12-12 11:27:58 -08:00
|
|
|
endif
|
2022-06-07 13:46:05 -07:00
|
|
|
|
|
|
|
if get_option('narrowing_warnings')
|
2022-08-04 21:46:03 -07:00
|
|
|
extra_flags += ['-Wconversion', '-Wnarrowing']
|
2022-06-07 13:46:05 -07:00
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('autovec_info')
|
2022-08-04 21:46:03 -07:00
|
|
|
# At least O2 is needed enable auto-vectorizion
|
|
|
|
extra_flags += [
|
|
|
|
'-march=native',
|
|
|
|
'-O2',
|
|
|
|
'-Wno-system-headers',
|
|
|
|
'-Rpass-analysis=loop-vectorize',
|
|
|
|
'-fopt-info-vec-missed',
|
|
|
|
'-fopt-info-vec',
|
|
|
|
]
|
2022-06-07 13:46:05 -07:00
|
|
|
endif
|
|
|
|
|
2022-08-18 11:19:34 -07:00
|
|
|
# Allow-list the flags against the compiler, and add them to the project
|
2021-12-12 15:37:44 +13:00
|
|
|
foreach flag : extra_flags
|
2022-08-04 21:46:03 -07:00
|
|
|
if cc.has_argument(flag)
|
|
|
|
add_project_arguments(flag, language: 'c')
|
|
|
|
endif
|
|
|
|
if cxx.has_argument(flag)
|
|
|
|
add_project_arguments(flag, language: 'cpp')
|
|
|
|
endif
|
2021-11-02 13:17:37 -07:00
|
|
|
endforeach
|
2022-08-18 11:19:34 -07:00
|
|
|
foreach flag : extra_link_flags
|
|
|
|
if cxx.has_link_argument(flag)
|
|
|
|
add_project_link_arguments(flag, language: 'cpp')
|
|
|
|
endif
|
|
|
|
endforeach
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2022-07-30 06:56:28 -07:00
|
|
|
|
|
|
|
# Gather data to populate config.h
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# The actual config.h file will be generated after interpreting
|
|
|
|
# all the build files in all the subdirs.
|
2021-01-12 20:45:49 +01:00
|
|
|
#
|
2020-12-14 04:14:08 +01:00
|
|
|
conf_data = configuration_data()
|
|
|
|
conf_data.set('version', meson.project_version())
|
2022-09-21 09:32:18 -07:00
|
|
|
conf_data.set('project_name', meson.project_name())
|
2021-01-04 23:54:37 +01:00
|
|
|
|
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-12-02 12:19:25 -08:00
|
|
|
conf_data.set10('C_SLIRP', get_option('use_slirp'))
|
|
|
|
conf_data.set10('C_NE2000', get_option('use_slirp'))
|
2020-12-14 04:14:08 +01:00
|
|
|
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'))
|
2022-08-04 13:58:40 -07:00
|
|
|
conf_data.set10('C_TRACY', get_option('tracy'))
|
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'
|
2022-08-04 21:46:03 -07:00
|
|
|
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'
|
2022-08-04 21:46:03 -07:00
|
|
|
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']
|
2022-08-04 21:46:03 -07:00
|
|
|
if conf_data.has(osdef)
|
|
|
|
conf_data.set10('C_DIRECTSERIAL', true)
|
|
|
|
endif
|
2021-01-21 16:18:40 +01:00
|
|
|
endforeach
|
|
|
|
|
2022-08-04 21:46:03 -07: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')
|
2022-08-04 21:46:03 -07:00
|
|
|
conf_data.set10('HAVE_BUILTIN_AVAILABLE', true)
|
2021-06-01 09:02:39 -05:00
|
|
|
endif
|
|
|
|
|
2021-08-16 12:23:27 -05:00
|
|
|
if cc.has_function('__builtin___clear_cache')
|
2022-08-04 21:46:03 -07:00
|
|
|
conf_data.set10('HAVE_BUILTIN_CLEAR_CACHE', true)
|
2021-08-16 12:23:27 -05:00
|
|
|
endif
|
|
|
|
|
2022-08-04 21:46:03 -07: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
|
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
if cc.has_function('mmap', prefix: '#include <sys/mman.h>')
|
|
|
|
conf_data.set10('HAVE_MMAP', true)
|
2021-06-01 09:02:39 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
if cc.has_header_symbol('sys/mman.h', 'MAP_JIT')
|
2022-08-04 21:46:03 -07:00
|
|
|
conf_data.set10('HAVE_MAP_JIT', true)
|
2021-06-01 09:02:39 -05:00
|
|
|
endif
|
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
if cc.has_function(
|
|
|
|
'pthread_jit_write_protect_np',
|
|
|
|
prefix: '#include <pthread.h>',
|
|
|
|
)
|
|
|
|
conf_data.set10('HAVE_PTHREAD_WRITE_PROTECT_NP', true)
|
2021-06-01 09:02:39 -05:00
|
|
|
endif
|
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
if cc.has_function(
|
|
|
|
'sys_icache_invalidate',
|
|
|
|
prefix: '#include <libkern/OSCacheControl.h>',
|
|
|
|
)
|
|
|
|
conf_data.set10('HAVE_SYS_ICACHE_INVALIDATE', true)
|
2021-06-01 09:02:39 -05:00
|
|
|
endif
|
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
if cxx.has_function(
|
|
|
|
'pthread_setname_np',
|
|
|
|
prefix: '#include <pthread.h>',
|
|
|
|
dependencies: dependency('threads'),
|
|
|
|
)
|
|
|
|
conf_data.set10('HAVE_PTHREAD_SETNAME_NP', true)
|
2021-01-03 22:30:19 -08:00
|
|
|
endif
|
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
if cc.has_function('realpath', prefix: '#include <stdlib.h>')
|
|
|
|
conf_data.set10('HAVE_REALPATH', true)
|
2021-01-04 21:32:03 +01:00
|
|
|
endif
|
|
|
|
|
2022-08-04 21:46:03 -07: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-12-02 08:26:58 -08:00
|
|
|
foreach header : ['pwd.h', 'strings.h', 'netinet/in.h']
|
2022-08-04 21:46:03 -07:00
|
|
|
if cc.has_header(header)
|
|
|
|
conf_data.set('HAVE_' + header.underscorify().to_upper(), 1)
|
|
|
|
endif
|
2021-01-14 22:35:18 +01:00
|
|
|
endforeach
|
2021-01-04 21:57:58 +01:00
|
|
|
|
2021-12-02 08:26:58 -08:00
|
|
|
# Check for the actual calls we need in socket.h, because some systems
|
|
|
|
# have socket.h but are missing some calls.
|
|
|
|
if cc.has_header('sys/socket.h')
|
2022-08-04 21:46:03 -07:00
|
|
|
if (
|
|
|
|
cc.has_function('getpeername', prefix: '#include <sys/socket.h>')
|
|
|
|
and cc.has_function('getsockname', prefix: '#include <sys/socket.h>')
|
|
|
|
)
|
|
|
|
conf_data.set10('HAVE_SYS_SOCKET_H', true)
|
|
|
|
endif
|
2021-12-02 08:26:58 -08:00
|
|
|
endif
|
|
|
|
|
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'
|
2022-08-04 21:46:03 -07:00
|
|
|
conf_data.set('NOMINMAX', true)
|
2021-01-21 16:33:25 +01:00
|
|
|
endif
|
|
|
|
|
2021-02-06 18:58:02 +01:00
|
|
|
if host_machine.system() in ['windows', 'cygwin']
|
2022-08-04 21:46:03 -07:00
|
|
|
conf_data.set('_USE_MATH_DEFINES', true)
|
2021-01-21 22:49:07 +01:00
|
|
|
endif
|
|
|
|
|
2020-12-23 07:51:26 +01:00
|
|
|
if host_machine.endian() == 'big'
|
2022-08-04 21:46:03 -07:00
|
|
|
conf_data.set('WORDS_BIGENDIAN', 1)
|
2020-12-23 07:51:26 +01:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
'''
|
2022-08-04 21:46:03 -07:00
|
|
|
if cc.compiles(set_prio_code, name: 'test for setpriority support')
|
|
|
|
conf_data.set('HAVE_SETPRIORITY', 1)
|
2021-01-13 02:04:50 +01:00
|
|
|
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 */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
'''
|
2022-08-04 21:46:03 -07:00
|
|
|
if cxx.compiles(builtin_expect_code, name: 'test for __builtin_expect support')
|
|
|
|
conf_data.set('C_HAS_BUILTIN_EXPECT', 1)
|
2021-01-21 15:49:04 +01:00
|
|
|
endif
|
|
|
|
|
2022-08-26 23:12:36 -07:00
|
|
|
atomic_code = '''
|
|
|
|
#include <atomic>
|
|
|
|
#include <cstdint>
|
|
|
|
int main() {
|
2022-08-26 23:35:03 -07:00
|
|
|
std::atomic<std::int16_t> x16 = 1;
|
|
|
|
std::atomic<std::int32_t> x32 = 1;
|
|
|
|
return static_cast<int>(x32.load() - x16.load());
|
2022-08-26 23:12:36 -07:00
|
|
|
}
|
|
|
|
'''
|
|
|
|
atomic_dep = dependency('', required: false)
|
|
|
|
if not cxx.links(atomic_code, name: 'compiler has built-in atomics')
|
|
|
|
atomic_dep = cxx.find_library('atomic')
|
|
|
|
endif
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2022-07-30 06:56:28 -07:00
|
|
|
# Gather external dependencies
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2020-12-14 04:14:08 +01:00
|
|
|
#
|
2022-08-04 14:01:46 -07:00
|
|
|
# system and compiler libraries
|
2022-08-04 21:46:03 -07:00
|
|
|
dl_dep = cc.find_library('dl', required: false)
|
|
|
|
stdcppfs_dep = cxx.find_library('stdc++fs', required: false)
|
|
|
|
threads_dep = dependency('threads')
|
2022-08-04 14:01:46 -07:00
|
|
|
|
|
|
|
# 3rd party libraries
|
2021-02-20 23:08:19 +01:00
|
|
|
static_libs_list = get_option('try_static_libs')
|
2022-08-11 17:03:11 -07:00
|
|
|
system_libs_list = get_option('system_libraries')
|
2022-08-04 14:01:46 -07:00
|
|
|
|
2022-08-07 11:59:49 -07:00
|
|
|
wants_tests = true
|
|
|
|
# tests are disabled for release builds unless requested
|
|
|
|
if get_option('buildtype') == 'release' and get_option('unit_tests').auto()
|
|
|
|
wants_tests = false
|
|
|
|
elif get_option('unit_tests').disabled()
|
|
|
|
wants_tests = false
|
|
|
|
endif
|
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
libiir_dep = dependency(
|
|
|
|
'iir',
|
|
|
|
version: '>= 1.9.3',
|
2022-08-05 00:49:04 -07:00
|
|
|
default_options: [
|
|
|
|
'default_library=static',
|
2022-08-07 11:59:49 -07:00
|
|
|
'tests=' + wants_tests.to_string(),
|
2022-08-05 00:49:04 -07:00
|
|
|
'warning_level=0',
|
|
|
|
],
|
2022-08-04 21:46:03 -07:00
|
|
|
allow_fallback: ('iir' not in system_libs_list),
|
|
|
|
static: ('iir' in static_libs_list or prefers_static_libs),
|
|
|
|
)
|
2022-08-04 14:01:46 -07:00
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
opus_dep = dependency(
|
|
|
|
'opusfile',
|
|
|
|
static: ('opusfile' in static_libs_list or prefers_static_libs),
|
|
|
|
)
|
2022-08-04 14:01:46 -07:00
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
sdl2_dep = dependency(
|
|
|
|
'sdl2',
|
|
|
|
version: '>= 2.0.5',
|
|
|
|
static: ('sdl2' in static_libs_list),
|
|
|
|
)
|
2022-08-04 14:01:46 -07:00
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
zlib_dep = dependency(
|
|
|
|
'zlib',
|
|
|
|
version: '>= 1.2.11',
|
|
|
|
allow_fallback: ('zlib' not in system_libs_list),
|
|
|
|
static: ('zlib' in static_libs_list or prefers_static_libs),
|
|
|
|
)
|
2022-08-04 14:01:46 -07:00
|
|
|
|
2022-08-11 17:05:39 -07:00
|
|
|
# SpeexDSP
|
|
|
|
# ~~~~~~~~
|
2022-09-23 14:59:27 -07:00
|
|
|
# Default to the system library
|
|
|
|
speexdsp_dep = dependency(
|
|
|
|
'speexdsp',
|
|
|
|
allow_fallback: false,
|
|
|
|
static: ('speexdsp' in static_libs_list or prefers_static_libs),
|
|
|
|
)
|
|
|
|
|
|
|
|
# The system has SpeexDSP, so test its floating-point handling
|
|
|
|
if speexdsp_dep.found()
|
|
|
|
system_speexdsp_test = cxx.run(
|
|
|
|
files('contrib/check-speexdsp/test_speexdsp_float_api.cpp'),
|
|
|
|
dependencies: speexdsp_dep,
|
|
|
|
name: 'SpeexDSP system library has reliable floating-point API',
|
2022-08-11 17:05:39 -07:00
|
|
|
)
|
2022-09-23 14:59:27 -07:00
|
|
|
is_system_speexdsp_reliable = (
|
|
|
|
system_speexdsp_test.compiled()
|
|
|
|
and system_speexdsp_test.returncode() == 0
|
2022-08-11 17:05:39 -07:00
|
|
|
)
|
2022-09-23 14:59:27 -07:00
|
|
|
if is_system_speexdsp_reliable
|
|
|
|
speexdsp_summary_msg = 'system library'
|
|
|
|
endif
|
2022-08-11 17:05:39 -07:00
|
|
|
endif
|
2022-09-23 14:59:27 -07:00
|
|
|
|
|
|
|
# The system doesn't have SpeexDSP or it's unreiable, so use the wrap
|
|
|
|
if not speexdsp_dep.found() or not is_system_speexdsp_reliable
|
2022-08-11 17:05:39 -07:00
|
|
|
speexdsp_dep = subproject(
|
|
|
|
'speexdsp',
|
|
|
|
default_options: ['default_library=static', 'warning_level=0'],
|
|
|
|
).get_variable('speexdsp_dep')
|
|
|
|
speexdsp_summary_msg = 'built-in'
|
|
|
|
endif
|
|
|
|
summary('SpeexDSP provider', speexdsp_summary_msg)
|
2022-08-04 14:01:46 -07:00
|
|
|
|
|
|
|
# Optional libraries
|
2022-08-05 00:49:04 -07:00
|
|
|
optional_dep = dependency('', required: false)
|
2021-02-20 23:08:19 +01:00
|
|
|
msg = 'You can disable this dependency with: -D@0@=false'
|
2021-01-18 22:56:03 +01:00
|
|
|
|
2022-08-04 14:01:46 -07:00
|
|
|
# SDL Networking
|
2022-08-05 00:49:04 -07:00
|
|
|
sdl2_net_dep = optional_dep
|
2020-12-14 04:14:08 +01:00
|
|
|
if get_option('use_sdl2_net')
|
2022-08-04 21:46:03 -07:00
|
|
|
sdl2_net_dep = dependency(
|
|
|
|
'SDL2_net',
|
|
|
|
version: '>= 2.0.0',
|
|
|
|
static: ('sdl2_net' in static_libs_list),
|
|
|
|
not_found_message: msg.format('use_sdl2_net'),
|
|
|
|
)
|
2020-12-14 04:14:08 +01:00
|
|
|
endif
|
|
|
|
|
2022-08-04 14:01:46 -07:00
|
|
|
# OpenGL
|
2022-08-05 00:49:04 -07:00
|
|
|
opengl_dep = optional_dep
|
2022-07-29 15:50:23 -07:00
|
|
|
opengl_summary_msg = 'Disabled'
|
|
|
|
if get_option('use_opengl') != 'false'
|
2022-08-04 21:46:03 -07:00
|
|
|
opengl_dep = dependency('gl', not_found_message: msg.format('use_opengl'))
|
2020-12-14 04:14:08 +01:00
|
|
|
endif
|
2022-08-05 00:49:04 -07:00
|
|
|
if (opengl_dep.found()
|
2022-07-30 10:45:42 -07:00
|
|
|
and host_machine.system() == 'linux'
|
2022-07-29 15:50:23 -07:00
|
|
|
and get_option('use_opengl') == 'auto'
|
2022-08-05 00:49:04 -07:00
|
|
|
and get_option('enable_debugger') != 'none')
|
|
|
|
|
|
|
|
warning('''OpenGL is disabled because it's not compatible with the debugger.
|
|
|
|
To use OpenGL with the debugger, force it with "-Duse_opengl=true"''')
|
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
conf_data.set10('C_OPENGL', false)
|
|
|
|
opengl_summary_msg = 'Found, but disabled due to conflict with debugger'
|
2022-07-29 15:50:23 -07:00
|
|
|
else
|
2022-08-04 21:46:03 -07:00
|
|
|
conf_data.set10('C_OPENGL', opengl_dep.found())
|
|
|
|
opengl_summary_msg = opengl_dep.found()
|
2022-07-29 15:50:23 -07:00
|
|
|
endif
|
|
|
|
summary('OpenGL support', opengl_summary_msg)
|
|
|
|
|
2022-08-05 00:49:04 -07:00
|
|
|
# FluidSynth (depends on glib)
|
|
|
|
fluid_dep = optional_dep
|
2020-12-14 04:14:08 +01:00
|
|
|
if get_option('use_fluidsynth')
|
2022-08-05 00:49:04 -07:00
|
|
|
lib_type = ('fluidsynth' in static_libs_list or prefers_static_libs).to_string()
|
2022-08-04 21:46:03 -07:00
|
|
|
fluid_dep = dependency(
|
|
|
|
'fluidsynth',
|
|
|
|
version: '>= 2.2.3',
|
2022-09-23 09:04:08 -05:00
|
|
|
modules: ['FluidSynth::libfluidsynth'],
|
2022-08-04 21:46:03 -07:00
|
|
|
allow_fallback: ('fluidsynth' not in system_libs_list),
|
|
|
|
static: ('fluidsynth' in static_libs_list or prefers_static_libs),
|
|
|
|
not_found_message: msg.format('use_fluidsynth'),
|
|
|
|
default_options: [
|
2022-08-05 00:49:04 -07:00
|
|
|
'try-static-deps=' + lib_type,
|
2022-08-04 21:46:03 -07:00
|
|
|
'enable-floats=true',
|
|
|
|
'openmp=disabled',
|
|
|
|
'enable-threads=false',
|
2022-08-13 17:55:52 -07:00
|
|
|
'tests=' + wants_tests.to_string(),
|
2022-08-04 21:46:03 -07:00
|
|
|
'warning_level=0',
|
|
|
|
],
|
|
|
|
)
|
2020-12-14 04:14:08 +01:00
|
|
|
endif
|
2022-08-04 14:01:46 -07:00
|
|
|
summary('FluidSynth support', fluid_dep.found())
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2022-08-05 00:49:04 -07:00
|
|
|
# slirp (depends on glib)
|
|
|
|
libslirp_dep = optional_dep
|
2021-12-09 15:05:51 -08:00
|
|
|
if get_option('use_slirp')
|
2022-08-04 21:46:03 -07:00
|
|
|
libslirp_dep = dependency(
|
|
|
|
'slirp',
|
|
|
|
version: '>= 4.6.1',
|
2022-08-05 00:49:04 -07:00
|
|
|
default_options: ['warning_level=0'],
|
2022-08-04 21:46:03 -07:00
|
|
|
allow_fallback: ('slirp' not in system_libs_list),
|
|
|
|
static: ('slirp' in static_libs_list or prefers_static_libs),
|
|
|
|
not_found_message: msg.format('use_slirp'),
|
|
|
|
)
|
2021-12-09 15:05:51 -08:00
|
|
|
endif
|
2022-08-04 14:01:46 -07:00
|
|
|
summary('slirp support', libslirp_dep.found())
|
2021-12-09 15:05:51 -08:00
|
|
|
|
2022-08-04 14:01:46 -07:00
|
|
|
# mt32emu
|
2022-08-05 00:49:04 -07:00
|
|
|
mt32emu_dep = optional_dep
|
2021-02-09 13:42:30 +01:00
|
|
|
if get_option('use_mt32emu')
|
2022-08-04 21:46:03 -07:00
|
|
|
mt32emu_dep = dependency(
|
|
|
|
'mt32emu',
|
|
|
|
version: '>= 2.5.3',
|
2022-08-05 00:49:04 -07:00
|
|
|
default_options: ['warning_level=0'],
|
2022-08-04 21:46:03 -07:00
|
|
|
allow_fallback: ('mt32emu' not in system_libs_list),
|
|
|
|
static: ('mt32emu' in static_libs_list or prefers_static_libs),
|
|
|
|
not_found_message: msg.format('use_mt32emu'),
|
|
|
|
)
|
2021-02-09 13:42:30 +01:00
|
|
|
endif
|
2022-08-04 14:01:46 -07:00
|
|
|
summary('mt32emu support', mt32emu_dep.found())
|
2021-02-09 13:42:30 +01:00
|
|
|
|
2022-08-04 14:01:46 -07:00
|
|
|
# PNG
|
2022-08-05 00:49:04 -07:00
|
|
|
png_dep = optional_dep
|
2020-12-14 04:14:08 +01:00
|
|
|
if get_option('use_png')
|
2022-08-04 21:46:03 -07:00
|
|
|
png_dep = dependency(
|
|
|
|
'libpng',
|
|
|
|
static: ('png' in static_libs_list or prefers_static_libs),
|
|
|
|
not_found_message: msg.format('use_png'),
|
|
|
|
)
|
2020-12-14 04:14:08 +01:00
|
|
|
endif
|
2022-08-14 09:31:00 +03:00
|
|
|
summary('PNG support', png_dep.found())
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2022-08-04 13:58:40 -07:00
|
|
|
# Tracy
|
2022-08-05 00:49:04 -07:00
|
|
|
tracy_dep = optional_dep
|
2022-06-28 20:26:07 -05:00
|
|
|
if get_option('tracy')
|
2022-08-05 00:49:04 -07:00
|
|
|
tracy_dep = dependency(
|
|
|
|
'tracy',
|
|
|
|
default_options: ['warning_level=0'],
|
|
|
|
static: ('tracy' in static_libs_list or prefers_static_libs),
|
|
|
|
not_found_message: msg.format('tracy'),
|
|
|
|
)
|
|
|
|
#tracy_proj = subproject('tracy')
|
|
|
|
#tracy_dep = tracy_proj.get_variable('tracy_dep')
|
2022-08-04 21:46:03 -07:00
|
|
|
add_project_arguments('-g', language: ['c', 'cpp'])
|
|
|
|
add_project_arguments('-fno-omit-frame-pointer', language: ['c', 'cpp'])
|
2022-06-28 20:26:07 -05:00
|
|
|
endif
|
2022-07-30 06:56:28 -07:00
|
|
|
|
2021-01-18 21:48:12 +01:00
|
|
|
# macOS-only dependencies
|
2022-08-05 00:49:04 -07:00
|
|
|
coreaudio_dep = optional_dep
|
|
|
|
coremidi_dep = optional_dep
|
|
|
|
corefoundation_dep = optional_dep
|
2021-01-18 21:48:12 +01:00
|
|
|
if host_machine.system() == 'darwin'
|
2021-11-03 09:41:31 -07:00
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
# ObjectiveC parsing, if possible
|
|
|
|
if cxx.has_argument('-lobjc')
|
|
|
|
add_project_arguments('-lobjc', language: 'cpp')
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Core Audio
|
|
|
|
coreaudio_dep = dependency(
|
|
|
|
'appleframeworks',
|
|
|
|
modules: ['CoreAudio', 'AudioUnit', 'AudioToolbox'],
|
|
|
|
required: false,
|
|
|
|
)
|
|
|
|
if coreaudio_dep.found()
|
|
|
|
if cxx.check_header('AudioToolbox/AUGraph.h')
|
|
|
|
conf_data.set('C_COREAUDIO', 1)
|
|
|
|
else
|
|
|
|
warning('''Core Audio disabled because header is unusable''')
|
|
|
|
endif
|
2021-11-03 09:41:31 -07:00
|
|
|
else
|
2022-08-04 21:46:03 -07:00
|
|
|
warning('''Core Audio disabled because Apple Framework missing''')
|
2021-11-03 09:41:31 -07:00
|
|
|
endif
|
2022-08-04 21:46:03 -07:00
|
|
|
summary('CoreAudio support', coreaudio_dep.found())
|
|
|
|
|
|
|
|
# Core MIDI
|
|
|
|
coremidi_dep = dependency(
|
|
|
|
'appleframeworks',
|
|
|
|
modules: ['CoreMIDI', 'CoreFoundation'],
|
|
|
|
required: false,
|
|
|
|
)
|
|
|
|
if coremidi_dep.found()
|
|
|
|
if cxx.check_header('CoreMIDI/MIDIServices.h')
|
|
|
|
conf_data.set('C_COREMIDI', 1)
|
|
|
|
else
|
|
|
|
warning('''Core Audio disabled because header is unusable''')
|
|
|
|
endif
|
2021-11-03 09:41:31 -07:00
|
|
|
else
|
2022-08-04 21:46:03 -07:00
|
|
|
warning('''Core MIDI disabled because Apple Framework missing''')
|
2021-11-03 09:41:31 -07:00
|
|
|
endif
|
2022-08-04 21:46:03 -07:00
|
|
|
summary('CoreMIDI support', coremidi_dep.found())
|
|
|
|
|
|
|
|
# Locale discovery
|
|
|
|
corefoundation_dep = dependency(
|
|
|
|
'appleframeworks',
|
|
|
|
modules: ['CoreFoundation'],
|
|
|
|
required: false,
|
|
|
|
)
|
|
|
|
if corefoundation_dep.found()
|
|
|
|
if cxx.check_header('CoreFoundation/CoreFoundation.h')
|
|
|
|
conf_data.set('C_COREFOUNDATION', 1)
|
|
|
|
else
|
|
|
|
warning('''Core Foundation disabled because header is unusable''')
|
|
|
|
endif
|
2021-12-11 19:20:43 -08:00
|
|
|
else
|
2022-08-04 21:46:03 -07:00
|
|
|
warning('''Core Foundation disabled becaue Foundation missing''')
|
2021-12-11 19:20:43 -08:00
|
|
|
endif
|
2022-08-04 21:46:03 -07:00
|
|
|
summary('CoreFoundation support', corefoundation_dep.found())
|
|
|
|
|
|
|
|
# SDL CD dependency
|
|
|
|
coreservices_dep = dependency(
|
|
|
|
'appleframeworks',
|
|
|
|
modules: ['CoreServices'],
|
|
|
|
required: false,
|
|
|
|
)
|
|
|
|
if coreservices_dep.found()
|
|
|
|
if cxx.check_header('CoreServices/CoreServices.h')
|
|
|
|
conf_data.set('C_CORESERVICES', 1)
|
|
|
|
else
|
|
|
|
warning('''Core Services disabled because header is unusable''')
|
|
|
|
endif
|
2022-02-15 19:37:18 -05:00
|
|
|
else
|
2022-08-04 21:46:03 -07:00
|
|
|
warning('''Core Services disabled because Frameworks is missing''')
|
2022-02-15 19:37:18 -05:00
|
|
|
endif
|
2022-08-04 21:46:03 -07:00
|
|
|
summary('CoreServices support', coreservices_dep.found())
|
|
|
|
|
|
|
|
# Apple Silicon has 16k pages
|
2022-08-28 22:26:07 -07:00
|
|
|
pagesize_cmd = run_command('pagesize', check: true)
|
2022-08-04 21:46:03 -07:00
|
|
|
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
|
2021-06-01 09:02:39 -05:00
|
|
|
endif
|
2021-01-18 21:48:12 +01:00
|
|
|
endif
|
|
|
|
|
2021-01-21 13:44:19 +01:00
|
|
|
# Linux-only dependencies
|
2022-08-05 00:49:04 -07:00
|
|
|
alsa_dep = optional_dep
|
2021-02-12 16:27:56 +01:00
|
|
|
using_linux = (host_machine.system() == 'linux')
|
2022-08-04 21:46:03 -07:00
|
|
|
force_alsa = (get_option('use_alsa') == 'true')
|
2021-02-12 16:27:56 +01:00
|
|
|
if force_alsa or (using_linux and get_option('use_alsa') == 'auto')
|
2022-08-04 21:46:03 -07:00
|
|
|
alsa_dep = dependency('alsa')
|
|
|
|
conf_data.set('C_ALSA', 1)
|
|
|
|
summary('ALSA support', alsa_dep.found())
|
2021-01-21 13:44:19 +01:00
|
|
|
endif
|
|
|
|
|
2021-01-22 01:36:26 +01:00
|
|
|
# Windows-only dependencies
|
2022-08-05 00:49:04 -07:00
|
|
|
winsock2_dep = optional_dep
|
|
|
|
winmm_dep = optional_dep
|
2021-02-06 18:58:02 +01:00
|
|
|
if host_machine.system() in ['windows', 'cygwin']
|
2022-08-04 21:46:03 -07:00
|
|
|
winsock2_dep = cxx.find_library('ws2_32', required: true)
|
|
|
|
summary('Winsock 2 support', winsock2_dep.found())
|
2022-08-04 14:01:46 -07:00
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
winmm_dep = cxx.find_library('winmm', required: true)
|
|
|
|
summary('Windows Multimedia support', winmm_dep.found())
|
2021-01-22 01:36:26 +01:00
|
|
|
endif
|
|
|
|
|
2022-07-30 06:56:28 -07:00
|
|
|
# Setup include directories
|
2021-10-04 14:23:26 +02:00
|
|
|
incdir = include_directories('include', '.')
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2022-08-26 13:04:30 -07:00
|
|
|
# A list of DOSBox's internal libraries populated
|
|
|
|
# by each of the src/ subdir imports below.
|
|
|
|
internal_deps = []
|
|
|
|
|
2021-08-24 12:09:11 -05:00
|
|
|
# bundled dependencies, in dependency-order
|
2020-12-14 04:14:08 +01:00
|
|
|
#
|
2021-12-30 09:30:34 -08:00
|
|
|
subdir('src/libs/ghc')
|
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')
|
2022-02-11 16:58:46 -05:00
|
|
|
subdir('src/libs/sdlcd')
|
2021-10-05 07:27:07 -07:00
|
|
|
subdir('src/libs/whereami')
|
2022-06-10 13:25:04 +10:00
|
|
|
subdir('src/libs/YM7128B_emu')
|
2022-08-26 13:04:30 -07:00
|
|
|
|
|
|
|
# ZMBV and TalChorus use some support functionality from misc
|
|
|
|
subdir('src/misc')
|
|
|
|
subdir('src/libs/zmbv')
|
2022-07-17 21:16:36 +10:00
|
|
|
subdir('src/libs/tal-chorus')
|
2022-06-10 13:25:04 +10:00
|
|
|
|
2022-06-25 15:30:58 -07:00
|
|
|
# A list of DOSBox's bundled 3rd party dependencies,
|
|
|
|
# as defined by the above subdir includes. Used for
|
2022-07-17 21:16:36 +10:00
|
|
|
# both the executable and libdosbox (unit testing).
|
2022-08-04 21:46:03 -07:00
|
|
|
third_party_deps = [
|
|
|
|
atomic_dep,
|
|
|
|
stdcppfs_dep,
|
|
|
|
sdl2_dep,
|
|
|
|
threads_dep,
|
2022-08-28 22:58:47 -07:00
|
|
|
ghc_dep,
|
2022-08-04 21:46:03 -07:00
|
|
|
libiir_dep,
|
|
|
|
libloguru_dep,
|
|
|
|
libsdlcd_dep,
|
|
|
|
tracy_dep,
|
|
|
|
libwhereami_dep,
|
|
|
|
libtalchorus_dep,
|
|
|
|
]
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2022-06-08 08:36:49 -07:00
|
|
|
# internal libs
|
2020-12-14 04:14:08 +01:00
|
|
|
subdir('src/cpu')
|
|
|
|
subdir('src/dos')
|
|
|
|
subdir('src/fpu')
|
|
|
|
subdir('src/gui')
|
|
|
|
subdir('src/hardware')
|
|
|
|
subdir('src/ints')
|
|
|
|
subdir('src/midi')
|
|
|
|
subdir('src/shell')
|
|
|
|
|
2022-06-25 15:30:58 -07:00
|
|
|
# debugger-specific libs
|
|
|
|
if get_option('enable_debugger') != 'none'
|
2022-08-04 21:46:03 -07:00
|
|
|
subdir('src/libs/PDCurses')
|
|
|
|
subdir('src/debug')
|
|
|
|
third_party_deps += libpdcurses_dep
|
2022-06-25 15:30:58 -07:00
|
|
|
endif
|
2020-12-14 04:14:08 +01:00
|
|
|
|
2021-01-12 20:45:49 +01:00
|
|
|
# generate config.h
|
2022-08-04 21:46:03 -07:00
|
|
|
configure_file(
|
|
|
|
input: 'src/config.h.in',
|
|
|
|
output: 'config.h',
|
|
|
|
configuration: conf_data,
|
|
|
|
)
|
2021-01-12 20:45:49 +01:00
|
|
|
|
|
|
|
|
2022-07-30 06:56:28 -07:00
|
|
|
# Setup the executable and libraries
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2020-12-14 04:14:08 +01:00
|
|
|
#
|
2022-08-04 21:46:03 -07: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'
|
2022-08-04 21:46:03 -07:00
|
|
|
winmod = import('windows')
|
|
|
|
res_file = winmod.compile_resources('src/winres.rc')
|
|
|
|
dosbox_sources += res_file
|
|
|
|
endif
|
|
|
|
|
|
|
|
executable(
|
|
|
|
'dosbox',
|
|
|
|
dosbox_sources,
|
|
|
|
dependencies: internal_deps + third_party_deps,
|
|
|
|
include_directories: incdir,
|
|
|
|
install: true,
|
|
|
|
)
|
2022-06-25 15:30:58 -07:00
|
|
|
|
2021-10-10 19:58:21 -07:00
|
|
|
# create a library so we can test things inside DOSBOX dep path
|
2022-08-04 21:46:03 -07:00
|
|
|
libdosbox = static_library(
|
|
|
|
'dosbox',
|
|
|
|
['src/dosbox.cpp', version_file],
|
|
|
|
include_directories: incdir,
|
|
|
|
dependencies: internal_deps + third_party_deps,
|
|
|
|
)
|
2021-12-30 09:30:34 -08:00
|
|
|
|
2022-08-04 21:46:03 -07:00
|
|
|
dosbox_dep = declare_dependency(link_with: libdosbox)
|
2021-10-10 19:58:21 -07:00
|
|
|
|
|
|
|
|
2022-07-30 06:56:28 -07:00
|
|
|
# Setup unit tests
|
|
|
|
# ~~~~~~~~~~~~~~~~
|
2021-10-10 19:58:21 -07:00
|
|
|
# Some tests use relative paths; in meson 0.56.0 this can be replaced
|
|
|
|
# with meson.project_source_root().
|
2022-07-30 06:56:28 -07:00
|
|
|
#
|
2022-08-07 11:59:49 -07:00
|
|
|
if wants_tests
|
|
|
|
project_source_root = meson.current_source_dir()
|
|
|
|
subdir('tests')
|
|
|
|
endif
|