build: Disable TRACE calls in release builds

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2021-03-01 14:44:50 +00:00 committed by Hans-Kristian Arntzen
parent 4da76cb51b
commit 78b5b347b8
2 changed files with 15 additions and 0 deletions

View File

@ -10,12 +10,16 @@ vkd3d_clang = vkd3d_compiler.get_id() == 'clang'
vkd3d_c_std = 'c11'
vkd3d_platform = target_machine.system()
vkd3d_buildtype = get_option('buildtype')
vkd3d_debug = vkd3d_buildtype == 'debug' or vkd3d_buildtype == 'debugoptimized'
enable_tests = get_option('enable_tests')
enable_extras = get_option('enable_extras')
enable_d3d12 = get_option('enable_d3d12')
enable_profiling = get_option('enable_profiling')
enable_renderdoc = get_option('enable_renderdoc')
enable_descriptor_qa = get_option('enable_descriptor_qa')
enable_trace = get_option('enable_trace')
if enable_d3d12 == 'auto'
enable_d3d12 = vkd3d_platform == 'windows'
@ -23,6 +27,12 @@ else
enable_d3d12 = enable_d3d12 == 'true'
endif
if enable_trace == 'auto'
enable_trace = vkd3d_debug
else
enable_trace = enable_trace == 'true'
endif
if vkd3d_platform != 'windows' and enable_d3d12
error('Standalone D3D12 is only supported on Windows.')
endif
@ -50,6 +60,10 @@ if enable_descriptor_qa
add_project_arguments('-DVKD3D_ENABLE_DESCRIPTOR_QA', language : 'c')
endif
if not enable_trace
add_project_arguments('-DVKD3D_NO_TRACE_MESSAGES', language : 'c')
endif
vkd3d_external_includes = [ './subprojects/Vulkan-Headers/include', './subprojects/SPIRV-Headers/include' ]
vkd3d_public_includes = [ './include' ] + vkd3d_external_includes
vkd3d_private_includes = [ './include/private' ] + vkd3d_public_includes

View File

@ -4,3 +4,4 @@ option('enable_d3d12', type : 'combo', value : 'auto', choices : ['
option('enable_profiling', type : 'boolean', value : false)
option('enable_renderdoc', type : 'boolean', value : false)
option('enable_descriptor_qa', type : 'boolean', value : false)
option('enable_trace', type : 'combo', value : 'auto', choices : ['false', 'true', 'auto'])