build config for integrated asset compiler
This commit is contained in:
parent
abb367dffc
commit
94f95157fe
109
meson.build
109
meson.build
@ -35,6 +35,8 @@ if buildtype == 'debug' or buildtype == 'debugoptimized'
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Gather dependencies
|
# Gather dependencies
|
||||||
|
common_incdirs = [include_directories(['contrib', 'src'])]
|
||||||
|
|
||||||
thread_dep = dependency('threads')
|
thread_dep = dependency('threads')
|
||||||
m_dep = compiler.find_library('m', required : false)
|
m_dep = compiler.find_library('m', required : false)
|
||||||
vk_dep = dependency('vulkan', required : false)
|
vk_dep = dependency('vulkan', required : false)
|
||||||
@ -45,7 +47,22 @@ if get_option('use_xlib')
|
|||||||
add_project_arguments(['-DRT_USE_XLIB'], language : 'c')
|
add_project_arguments(['-DRT_USE_XLIB'], language : 'c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
incdir = include_directories(['contrib', 'src'])
|
runtime_incdirs = common_incdirs
|
||||||
|
runtime_linkargs = []
|
||||||
|
runtime_additional_sources = []
|
||||||
|
runtime_cargs = []
|
||||||
|
if get_option('build_asset_compiler')
|
||||||
|
runtime_cargs += ['-DRT_BUILD_ASSET_COMPILER']
|
||||||
|
|
||||||
|
# Shaderc for shaders
|
||||||
|
shaderc_include = include_directories('contrib/shaderc/libshaderc/include')
|
||||||
|
shaderc_libdir = 'NONE'
|
||||||
|
if host_machine.system() == 'windows'
|
||||||
|
shaderc_libdir = meson.project_source_root() / 'contrib/shaderc/build-win/libshaderc/Release'
|
||||||
|
endif
|
||||||
|
runtime_incdirs += shaderc_include
|
||||||
|
runtime_linkargs += ['-L'+shaderc_libdir, '-lshaderc_combined']
|
||||||
|
endif
|
||||||
|
|
||||||
runtime_lib = library('rt',
|
runtime_lib = library('rt',
|
||||||
# Project Sources
|
# Project Sources
|
||||||
@ -91,7 +108,9 @@ runtime_lib = library('rt',
|
|||||||
'contrib/xxhash/xxhash.c',
|
'contrib/xxhash/xxhash.c',
|
||||||
'contrib/lz4/lz4.c',
|
'contrib/lz4/lz4.c',
|
||||||
dependencies : [thread_dep, m_dep, windowing_dep],
|
dependencies : [thread_dep, m_dep, windowing_dep],
|
||||||
include_directories : incdir,
|
include_directories : runtime_incdirs,
|
||||||
|
link_args : runtime_linkargs,
|
||||||
|
c_args : runtime_cargs,
|
||||||
c_pch : 'pch/rt_pch.h')
|
c_pch : 'pch/rt_pch.h')
|
||||||
|
|
||||||
|
|
||||||
@ -120,7 +139,7 @@ if vk_dep.found()
|
|||||||
'contrib/volk/volk.h',
|
'contrib/volk/volk.h',
|
||||||
'contrib/volk/volk.c',
|
'contrib/volk/volk.c',
|
||||||
dependencies : [m_dep, vk_inc_dep, windowing_dep],
|
dependencies : [m_dep, vk_inc_dep, windowing_dep],
|
||||||
include_directories : incdir,
|
include_directories : common_incdirs,
|
||||||
link_with : [runtime_lib],
|
link_with : [runtime_lib],
|
||||||
c_pch : 'pch/vk_pch.h',
|
c_pch : 'pch/vk_pch.h',
|
||||||
c_args : platform_defs)
|
c_args : platform_defs)
|
||||||
@ -128,66 +147,60 @@ if vk_dep.found()
|
|||||||
static_renderer_lib = vk_renderer_lib
|
static_renderer_lib = vk_renderer_lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
shaderc_include = include_directories('contrib/shaderc/libshaderc/include')
|
|
||||||
shaderc_libdir = 'NONE'
|
|
||||||
if host_machine.system() == 'windows'
|
|
||||||
shaderc_libdir = meson.project_source_root() / 'contrib/shaderc/build-win/libshaderc/Release'
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Handle linking against both runtime and renderer if we build static libs
|
# Handle linking against both runtime and renderer if we build static libs
|
||||||
runtime_link_libs = []
|
engine_link_libs = []
|
||||||
if get_option('default_library') == 'static'
|
if get_option('default_library') == 'static'
|
||||||
runtime_link_libs = [runtime_lib, static_renderer_lib]
|
engine_link_libs = [runtime_lib, static_renderer_lib]
|
||||||
else
|
else
|
||||||
runtime_link_libs = [runtime_lib]
|
engine_link_libs = [runtime_lib]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Asset Compiler Tool
|
# Asset Compiler Tool
|
||||||
executable('assetc',
|
#executable('assetc',
|
||||||
'src/tools/assetc/assetmeta.h',
|
# 'src/tools/assetc/assetmeta.h',
|
||||||
'src/tools/assetc/assetsettings.h',
|
# 'src/tools/assetc/assetsettings.h',
|
||||||
'src/tools/assetc/dependency_tracking.h',
|
# 'src/tools/assetc/dependency_tracking.h',
|
||||||
'src/tools/assetc/description_parser.h',
|
# 'src/tools/assetc/description_parser.h',
|
||||||
'src/tools/assetc/options.h',
|
# 'src/tools/assetc/options.h',
|
||||||
'src/tools/assetc/packages.h',
|
# 'src/tools/assetc/packages.h',
|
||||||
'src/tools/assetc/processing.h',
|
# 'src/tools/assetc/processing.h',
|
||||||
'src/tools/assetc/processing_flags.h',
|
# 'src/tools/assetc/processing_flags.h',
|
||||||
'src/tools/assetc/utils.h',
|
# 'src/tools/assetc/utils.h',
|
||||||
|
#
|
||||||
'src/tools/assetc/assetc.c',
|
# 'src/tools/assetc/assetc.c',
|
||||||
'src/tools/assetc/assetmeta.c',
|
# 'src/tools/assetc/assetmeta.c',
|
||||||
'src/tools/assetc/assetsettings.c',
|
# 'src/tools/assetc/assetsettings.c',
|
||||||
'src/tools/assetc/dependency_tracking.c',
|
# 'src/tools/assetc/dependency_tracking.c',
|
||||||
'src/tools/assetc/description_parser.c',
|
# 'src/tools/assetc/description_parser.c',
|
||||||
'src/tools/assetc/discovery.c',
|
# 'src/tools/assetc/discovery.c',
|
||||||
'src/tools/assetc/packages.c',
|
# 'src/tools/assetc/packages.c',
|
||||||
'src/tools/assetc/pipeline_processor.c',
|
# 'src/tools/assetc/pipeline_processor.c',
|
||||||
'src/tools/assetc/processor.c',
|
# 'src/tools/assetc/processor.c',
|
||||||
'src/tools/assetc/shader_processor.c',
|
# 'src/tools/assetc/shader_processor.c',
|
||||||
'src/tools/assetc/uidtable.c',
|
# 'src/tools/assetc/uidtable.c',
|
||||||
'src/tools/assetc/utils.c',
|
# 'src/tools/assetc/utils.c',
|
||||||
|
#
|
||||||
# Contrib sources
|
# # Contrib sources
|
||||||
'contrib/xxhash/xxhash.c',
|
# 'contrib/xxhash/xxhash.c',
|
||||||
'contrib/lz4/lz4.c',
|
# 'contrib/lz4/lz4.c',
|
||||||
include_directories : [incdir, shaderc_include],
|
# include_directories : [incdir, shaderc_include],
|
||||||
dependencies : [],
|
# dependencies : [],
|
||||||
link_with : runtime_link_libs,
|
# link_with : engine_link_libs,
|
||||||
link_args : ['-L'+shaderc_libdir, '-lshaderc_combined'],
|
# link_args : ['-L'+shaderc_libdir, '-lshaderc_combined'],
|
||||||
win_subsystem : 'console')
|
# win_subsystem : 'console')
|
||||||
|
|
||||||
# Game
|
# Game
|
||||||
executable('voyage',
|
executable('voyage',
|
||||||
'src/game/voyage.c',
|
'src/game/voyage.c',
|
||||||
include_directories : incdir,
|
include_directories : common_incdirs,
|
||||||
link_with : runtime_link_libs,
|
link_with : engine_link_libs,
|
||||||
win_subsystem : 'windows')
|
win_subsystem : 'windows')
|
||||||
|
|
||||||
# Unit Tests
|
# Unit Tests
|
||||||
rttest_exe = executable('rttest',
|
rttest_exe = executable('rttest',
|
||||||
'src/tests/rttest.c',
|
'src/tests/rttest.c',
|
||||||
link_with : runtime_link_libs,
|
link_with : engine_link_libs,
|
||||||
include_directories : incdir,
|
include_directories : common_incdirs,
|
||||||
win_subsystem : 'console')
|
win_subsystem : 'console')
|
||||||
test('runtime test', rttest_exe)
|
test('runtime test', rttest_exe)
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
option('use_xlib', type : 'boolean', value : false, description : 'Use Xlib for window creation under linux')
|
option('use_xlib', type : 'boolean', value : false, description : 'Use Xlib for window creation under linux')
|
||||||
option('error_report_debugbreak', type : 'boolean', value : true, description : 'Debugbreak in vyReportError')
|
option('error_report_debugbreak', type : 'boolean', value : true, description : 'Debugbreak in ReportError')
|
||||||
|
option('build_asset_compiler', type : 'boolean', value : true, description : 'Enables or disables the asset compiler inside runtime.')
|
||||||
|
Loading…
Reference in New Issue
Block a user