summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorJesse Natalie <jenatali@microsoft.com>2021-09-27 07:23:54 -0700
committerMarge Bot <emma+marge@anholt.net>2021-11-19 15:36:59 +0000
commitad8626741236c312b08fcdf445fd806cf46b628f (patch)
treed0875e43edf0db7ab1adf01b21583f692ea48d9f /meson.build
parent21ec880bf9f522a598fadf0344abe253f850b68c (diff)
meson: Don't override built-in cpp_rtti option, error if it's invalid
Reviewed-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13064>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build19
1 files changed, 10 insertions, 9 deletions
diff --git a/meson.build b/meson.build
index 51392ee264f..d1606a7824a 100644
--- a/meson.build
+++ b/meson.build
@@ -909,10 +909,14 @@ if get_option('vmware-mks-stats')
endif
_opencl = get_option('gallium-opencl')
+_rtti = get_option('cpp_rtti')
if _opencl != 'disabled'
if not with_gallium
error('OpenCL Clover implementation requires at least one gallium driver.')
endif
+ if not _rtti
+ error('The Clover OpenCL state tracker requires rtti')
+ endif
with_libclc = true
with_gallium_opencl = true
@@ -1738,19 +1742,16 @@ if with_llvm
# builtin llvm-config based finder. A new generic variable getter method
# has also been added, so we'll use that if we can, to cover the cmake case.
if dep_llvm.type_name() == 'internal'
- _rtti = subproject('llvm').get_variable('has_rtti', true)
+ _llvm_rtti = subproject('llvm').get_variable('has_rtti', true)
else
# The CMake finder will return 'ON', the llvm-config will return 'YES'
- _rtti = ['ON', 'YES'].contains(dep_llvm.get_variable(cmake : 'LLVM_ENABLE_RTTI', configtool: 'has-rtti'))
+ _llvm_rtti = ['ON', 'YES'].contains(dep_llvm.get_variable(cmake : 'LLVM_ENABLE_RTTI', configtool: 'has-rtti'))
endif
- if not _rtti
- if with_gallium_opencl
- error('The Clover OpenCL state tracker requires rtti, you need to turn off clover or use an LLVM built with LLVM_ENABLE_RTTI.')
- endif
- if cc.get_id() == 'msvc'
- cpp_args += '/GR-'
+ if _rtti != _llvm_rtti
+ if _llvm_rtti
+ error('LLVM was built with RTTI, cannot build Mesa with RTTI disabled. Remove cpp_rtti disable switch or use LLVM built without LLVM_ENABLE_RTTI.')
else
- cpp_args += '-fno-rtti'
+ error('LLVM was built without RTTI, so Mesa must also disable RTTI. Use an LLVM built with LLVM_ENABLE_RTTI or add cpp_rtti=false.')
endif
endif