project('voyage', ['c', 'cpp'], default_options: ['buildtype=debug', 'b_sanitize=address', 'c_std=c17', 'cpp_std=c++14', 'warning_level=3', 'werror=true', 'b_vscrt=static_from_buildtype', 'default_library=static', 'b_rtti=false', 'cpp_eh=none']) compiler = meson.get_compiler('c') buildtype = get_option('buildtype') # Build options if compiler.get_argument_syntax() == 'gcc' add_project_arguments( ['-Wconversion', '-Wno-sign-conversion', '-Wdouble-promotion', '-Wno-unused-function', '-Wno-unused-parameter'], language : ['c', 'cpp'] ) elif compiler.get_argument_syntax() == 'msvc' add_project_arguments( ['/wd4146', '/wd4245', '/wd4100', '/D_CRT_SECURE_NO_WARNINGS'], language: ['c', 'cpp'] ) if buildtype == 'debug' add_project_arguments(['/RTCsu'], language : ['c', 'cpp']) endif # Allow nameless struct/unions (standard in C11) add_project_arguments(['/wd4201'], language : 'cpp') endif if get_option('default_library') == 'static' add_project_arguments(['-DRT_STATIC_LIB'], language : ['c', 'cpp']) endif if get_option('error_report_debugbreak') add_project_arguments(['-DRT_ERROR_REPORT_DEBUGBREAK'], language : ['c', 'cpp']) endif # Debug specific flags if buildtype == 'debug' or buildtype == 'debugoptimized' add_project_arguments([ '-DRT_DEBUG'], language : ['c', 'cpp']) endif # Gather dependencies thread_dep = dependency('threads') m_dep = compiler.find_library('m', required : false) vk_dep = dependency('vulkan', required : false) windowing_dep = [] if get_option('use_xlib') windowing_dep = dependency('x11', required : true) add_project_arguments(['-DRT_USE_XLIB'], language : ['c', 'cpp']) endif # Copy file utility copy_util = find_program('scripts/copy_util.py') engine_incdir = include_directories('src') contrib_dir = meson.project_source_root() / 'contrib' subdir('src') # Handle linking against both runtime and renderer if we build static libs engine_link_libs = [] if get_option('default_library') == 'static' if get_option('static_renderer') == 'vk' engine_link_libs = [runtime_lib, vk_renderer_lib] else error('Invalid static_renderer option ', get_option('static_renderer')) endif else engine_link_libs = [runtime_lib] endif # Unit/Integration test driver subdir('tests') # Declare dependencies, to enable using the engine as a subproject engine_dep = declare_dependency(link_with : engine_link_libs, include_directories : engine_incdir) assetc_dep = declare_dependency(link_with : asset_compiler, include_directories : engine_incdir) # "inline" game if get_option('game_as_subdir') subdir('src/game') endif