Mesa (master): meson: use a feature option for microsoft-clc
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Nov 23 17:53:18 UTC 2020
Module: Mesa
Branch: master
Commit: a5227465c13ae74651a932a82aeae65683f4a063
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5227465c13ae74651a932a82aeae65683f4a063
Author: Dylan Baker <dylan.c.baker at intel.com>
Date: Thu Nov 19 16:14:54 2020 -0800
meson: use a feature option for microsoft-clc
It's less code and makes the configuration easier to fine tune.
Fixes: ff05da7f8dc4aa531704d48f718514e3b1fff45d
("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7699>
---
meson.build | 31 ++++++++++++-------------------
meson_options.txt | 3 +--
2 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/meson.build b/meson.build
index 9caf6fadf74..60ce1b11ffc 100644
--- a/meson.build
+++ b/meson.build
@@ -299,25 +299,18 @@ if with_aco_tests and not with_amd_vk
error('ACO tests require Radv')
endif
-_microsoft_clc = get_option('microsoft-clc')
-if _microsoft_clc == 'auto'
- with_microsoft_clc = false
-else
- with_microsoft_clc = _microsoft_clc == 'true'
-endif
-
-if with_microsoft_clc
- with_clc = true
- dep_clang = dependency(
- 'clang',
- method: 'cmake',
- static: true,
- modules: [
- 'clangBasic', 'clangCodeGen', 'clangDriver', 'clangFrontend', 'clangFrontendTool',
- 'clangHandleCXX', 'clangHandleLLVM',
- ],
- )
-endif
+dep_clang = dependency(
+ 'clang',
+ method : 'cmake',
+ static : true,
+ modules : [
+ 'clangBasic', 'clangCodeGen', 'clangDriver', 'clangFrontend', 'clangFrontendTool',
+ 'clangHandleCXX', 'clangHandleLLVM',
+ ],
+ required : get_option('microsoft-clc'),
+)
+with_microsoft_clc = dep_clang.found()
+with_clc = dep_clang.found()
if host_machine.system() == 'darwin'
with_dri_platform = 'apple'
diff --git a/meson_options.txt b/meson_options.txt
index bae9aa82c2d..2f40a3dca24 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -268,9 +268,8 @@ option(
)
option(
'microsoft-clc',
- type : 'combo',
+ type : 'feature',
value : 'auto',
- choices : ['auto', 'true', 'false'],
description : 'Build support for the Microsoft CLC to DXIL compiler'
)
option(
More information about the mesa-commit
mailing list