From 32e1afc7a104b837b3440a58b4a49640c401e511 Mon Sep 17 00:00:00 2001 From: pchome Date: Wed, 15 May 2019 09:40:50 +0300 Subject: [PATCH] [build] Add options to disable dxgi/d3d* build --- meson_options.txt | 3 +++ src/d3d11/meson.build | 5 +++++ src/dxgi/meson.build | 5 ----- src/meson.build | 31 +++++++++++++++++++++++++++---- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 6e0f05b57..b3c235f90 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1 +1,4 @@ option('enable_tests', type : 'boolean', value : false) +option('enable_dxgi', type : 'boolean', value : true, description: 'Build DXGI') +option('enable_d3d10', type : 'boolean', value : true, description: 'Build D3D10') +option('enable_d3d11', type : 'boolean', value : true, description: 'Build D3D11') diff --git a/src/d3d11/meson.build b/src/d3d11/meson.build index 68809e261..994df7e93 100644 --- a/src/d3d11/meson.build +++ b/src/d3d11/meson.build @@ -1,5 +1,10 @@ d3d11_res = wrc_generator.process('version.rc') +dxgi_shaders = files([ + '../dxgi/shaders/dxgi_presenter_frag.frag', + '../dxgi/shaders/dxgi_presenter_vert.vert', +]) + dxgi_common_src = [ '../dxgi/dxgi_format.cpp', '../dxgi/dxgi_monitor.cpp', diff --git a/src/dxgi/meson.build b/src/dxgi/meson.build index d21356395..9e7bf33ba 100644 --- a/src/dxgi/meson.build +++ b/src/dxgi/meson.build @@ -1,10 +1,5 @@ dxgi_res = wrc_generator.process('version.rc') -dxgi_shaders = files([ - 'shaders/dxgi_presenter_frag.frag', - 'shaders/dxgi_presenter_vert.vert', -]) - dxgi_src = [ 'dxgi_adapter.cpp', 'dxgi_enums.cpp', diff --git a/src/meson.build b/src/meson.build index 08000450e..395aaaad9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -2,7 +2,30 @@ subdir('util') subdir('spirv') subdir('vulkan') subdir('dxvk') -subdir('dxgi') -subdir('dxbc') -subdir('d3d11') -subdir('d3d10') + +if get_option('enable_dxgi') + if not get_option('enable_d3d10') and not get_option('enable_d3d11') + error('D3D10 and/or D3D11 required for DXGI to properly functionning.') + endif + subdir('dxgi') +endif + +if get_option('enable_d3d10') or get_option('enable_d3d11') or get_option('enable_tests') + subdir('dxbc') +endif + +if get_option('enable_d3d11') + subdir('d3d11') +endif + +if get_option('enable_d3d10') + if not get_option('enable_d3d11') + error('D3D11 required for D3D10 to properly functionning.') + endif + subdir('d3d10') +endif + +# Nothing selected +if not get_option('enable_d3d10') and not get_option('enable_d3d11') and not get_option('enable_tests') + error('Nothing selected to be built. Please, enable at least D3D11 or TESTS.') +endif