project('voyage', 'c', default_options: ['buildtype=debugoptimized', 'b_sanitize=address', 'c_std=c17', 'warning_level=3']) 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' ) elif compiler.get_argument_syntax() == 'msvc' add_project_arguments( ['/wd4146', '/wd4245', '/wd4100', '/D_CRT_SECURE_NO_WARNINGS'], language: 'c' ) if buildtype == 'debug' add_project_arguments(['/RTCsu'], language : 'c') endif endif # Debug specific flags if buildtype == 'debug' or buildtype == 'debugoptimized' add_project_arguments([ '-DDEBUG'], language : 'c') endif # Gather dependencies thread_dep = dependency('threads') m_dep = compiler.find_library('m', required : false) vk_dep = dependency('vulkan', required : false) # glfw_proj = subproject('glfw', default_options : 'default_library=static') # glfw_dep = glfw_proj.get_variable('glfw_dep') incdir = include_directories(['contrib', 'src']) runtime_lib = library('vyrt', # Project Sources 'src/runtime/runtime.h', 'src/runtime/gfx.h', 'src/runtime/renderer_api.h', 'src/runtime/fio.h', 'src/runtime/config.h', 'src/runtime/threading.h', 'src/runtime/app.h', 'src/runtime/dynamic_libs.h', 'src/runtime/error_report.c', 'src/runtime/gfx_main.c', 'src/runtime/gfx_shader_loading.c', 'src/runtime/config.c', 'src/runtime/runtime_cvars.c', 'src/runtime/threading.c', 'src/runtime/fio.c', 'src/runtime/app.c', 'src/runtime/dynamic_libs.c', # Contrib Sources 'contrib/xxhash/xxhash.c', dependencies : [thread_dep, m_dep], include_directories : incdir, c_pch : 'pch/rt_pch.h') if vk_dep.found() vk_renderer_lib = library('vyvk', # Project Sources 'src/renderer/vk/gpu.h', 'src/renderer/vk/init.c', 'src/renderer/vk/gfx_pipelines.c', dependencies : [m_dep, vk_dep], include_directories : incdir, link_with : [runtime_lib], c_pch : 'pch/vk_pch.h') endif executable('voyage', 'src/game/voyage.c', include_directories : incdir, link_with : [runtime_lib], win_subsystem : 'windows')