From 99b0421c32529d5d6ce52edcbae0c2bf577d4940 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Fri, 17 Jul 2020 12:53:36 +0200 Subject: [PATCH] meson: Add build option to enable a profiled build. Signed-off-by: Hans-Kristian Arntzen --- libs/vkd3d-common/meson.build | 1 + meson.build | 5 +++++ meson_options.txt | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-common/meson.build b/libs/vkd3d-common/meson.build index 80fdb0e5..e2a992bf 100644 --- a/libs/vkd3d-common/meson.build +++ b/libs/vkd3d-common/meson.build @@ -2,6 +2,7 @@ vkd3d_common_src = [ 'debug.c', 'memory.c', 'utf8.c', + 'profiling.c' ] vkd3d_common_lib = static_library('vkd3d_common', vkd3d_common_src, diff --git a/meson.build b/meson.build index 0aa9375c..23d88db5 100644 --- a/meson.build +++ b/meson.build @@ -12,6 +12,7 @@ vkd3d_platform = target_machine.system() enable_tests = get_option('enable_tests') enable_extras = get_option('enable_extras') enable_standalone_d3d12 = get_option('enable_standalone_d3d12') +enable_profiling = get_option('enable_profiling') if vkd3d_platform != 'windows' and enable_standalone_d3d12 error('Standalone D3D12 is only supported on Windows.') @@ -25,6 +26,10 @@ if enable_standalone_d3d12 add_project_arguments('-DVKD3D_BUILD_STANDALONE_D3D12', language : 'c') endif +if enable_profiling + add_project_arguments('-DVKD3D_ENABLE_PROFILING', 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 diff --git a/meson_options.txt b/meson_options.txt index 1b557718..bba35b2a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,4 @@ option('enable_tests', type : 'boolean', value : false) option('enable_extras', type : 'boolean', value : false) -option('enable_standalone_d3d12', type : 'boolean', value : false) \ No newline at end of file +option('enable_standalone_d3d12', type : 'boolean', value : false) +option('enable_profiling', type : 'boolean', value : false)