Voxen is a vulkan voxel engine.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

58 lines
2.3 KiB

project('voxen', 'c', default_options : ['default_library=static', 'c_std=c99'])
add_project_arguments(['-Werror', '-Wall', '-Wpedantic', '-D_XOPEN_SOURCE=600', '-D_GNU_SOURCE'], language : 'c')
incdir = include_directories(['include', 'src'])
if get_option('buildtype').startswith('debug')
add_project_arguments('-DVOXEN_DEBUG', language : 'c')
glslcopt = '-O0'
else
glslcopt = '-Os'
endif
depvulkan = dependency('vulkan', version : '>=1.0')
#Graphene subproject settings
subproject('graphene', default_options : ['default_library=static', 'introspection=false', 'tests=false', 'benchmarks=false', 'gobject_types=false', 'c_std=c99'])
#This is the syntax for using it as a subproject.
depgraphene = dependency('graphene', fallback : ['graphene', 'graphene_dep'])
#glsl to spv.
glslc = find_program('glslc', 'subprojects/shadercbuild/glslc/glslc')
#shaders = custom_target('shaders', input : ['src/shader/shader.vert', 'src/shader/shader.frag'], output : ['vert.spv', 'shader.frag.spv'], command : [glslc, '-c', '-Werror', '-mfmt=c', glslcopt, '@INPUT@'])
shadergen = generator(glslc,
output : '@PLAINNAME@.spv',
arguments : ['-c', '-Werror', '-mfmt=c', glslcopt, '@INPUT@', '-o', '@OUTPUT@'])
vertshader = shadergen.process('src/shader/shader.vert')
fragshader = shadergen.process('src/shader/shader.frag')
#vec
libvec = library('vec', 'src/vec.c', include_directories : incdir)
depvec = declare_dependency(link_with : libvec, include_directories : incdir)
#library
voxensrc = ['src/voxen_instance.c', 'src/voxen_vulkan.c', 'src/voxen_vulkan_pick_gpu.c', 'src/voxen_tools.c', 'src/voxen_debug.c', 'src/voxen_materials.c']
libvoxen = library('voxen', voxensrc, vertshader, fragshader, include_directories : incdir, dependencies: [depvulkan, depgraphene, depvec])
depvoxen = declare_dependency(link_with : libvoxen, include_directories : incdir)
#if get_option('buildtype').startswith('debug')
#else
# libvoxenshared = shared_library('voxen', voxensrc, shaders, include_directories : incdir, dependencies: [depvulkan])
#endif
if not meson.is_subproject()
#"voxenexample" dependencies. 3.2 is when vulkan support was added
depglfw = dependency('glfw3', version : '>=3.2')
#"voxenexample"
executable('voxenexample', 'src/example/example.c', include_directories : incdir, dependencies: [depvoxen, depglfw])
endif