Revert "meson: Add support for using cmake for finding LLVM"

This reverts commit 5157a42765.

There is a meson bug that causes llvm to always be statically linked,
which is obviously not what we want. I haven't had time to look into it
yet, but for now let's just revert it.
This commit is contained in:
Dylan Baker
2019-06-28 16:36:38 -07:00
parent 69f9fbab8a
commit 97c2c4546c
4 changed files with 13 additions and 32 deletions

View File

@@ -1264,6 +1264,7 @@ if _llvm != 'false'
with_gallium_opencl or _llvm == 'true'
),
static : not _shared_llvm,
method : 'config-tool',
)
with_llvm = dep_llvm.found()
endif
@@ -1277,17 +1278,7 @@ if with_llvm
# LLVM can be built without rtti, turning off rtti changes the ABI of C++
# programs, so we need to build all C++ code in mesa without rtti as well to
# ensure that linking works.
#
# In meson 0.51.0 we can use cmake to find LLVM in addittion to meson's
# 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 meson.version().version_compare('>=0.51')
# 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'))
else
_rtti = dep_llvm.get_configtool_variable('has-rtti') == 'YES'
endif
if not _rtti
if dep_llvm.get_configtool_variable('has-rtti') == 'NO'
if with_gallium_nouveau
error('The Nouveau driver requires rtti. You either need to turn off nouveau or use an LLVM built with LLVM_ENABLE_RTTI.')
elif with_gallium_opencl

View File

@@ -1,4 +1,4 @@
# Copyright © 2017-2019 Intel Corporation
# Copyright © 2017-2018 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -19,17 +19,14 @@
# SOFTWARE.
if meson.version().version_compare('>=0.51')
_llvm_includedir = dep_llvm.get_variable(configtool : 'includedir', cmake : 'LLVM_INCLUDE_DIR')
else
_llvm_includedir = dep_llvm.get_configtool_variable('includedir')
endif
gen_builder_hpp = custom_target(
'gen_builder.hpp',
input : [
swr_gen_llvm_ir_macros_py,
join_paths(_llvm_includedir, 'llvm', 'IR', 'IRBuilder.h')
join_paths(
dep_llvm.get_configtool_variable('includedir'), 'llvm', 'IR',
'IRBuilder.h'
)
],
output : 'gen_builder.hpp',
command : [

View File

@@ -1,4 +1,4 @@
# Copyright © 2017-2019 Intel Corporation
# Copyright © 2017-2018 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -25,12 +25,6 @@ if with_opencl_icd
clover_cpp_args += '-DHAVE_CLOVER_ICD'
endif
if meson.version().version_compare('>=0.51')
_clang_resources = join_paths(dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool : 'libdir'), 'clang', dep_llvm.version(), 'include')
else
_clang_resources = join_paths(dep_llvm.get_configtool_variable('libdir'), 'clang', dep_llvm.version(), 'include')
endif
libclllvm = static_library(
'clllvm',
files(
@@ -49,7 +43,10 @@ libclllvm = static_library(
cpp_vis_args,
'-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('includedir')),
'-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('libexecdir')),
'-DCLANG_RESOURCE_DIR="@0@"'.format(_clang_resources),
'-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
dep_llvm.get_configtool_variable('libdir'), 'clang',
dep_llvm.version(), 'include',
)),
],
dependencies : [dep_llvm, dep_elf],
override_options : clover_cpp_std,

View File

@@ -29,11 +29,7 @@ if with_ld_version_script
opencl_link_deps += files('opencl.sym')
endif
if meson.version().version_compare('>=0.51')
llvm_libdir = dep_llvm.get_variable(configtool : 'libdir', cmake : 'LLVM_LIBRARY_DIR')
else
llvm_libdir = dep_llvm.get_configtool_variable('libdir')
endif
llvm_libdir = dep_llvm.get_configtool_variable('libdir')
opencl_libname = with_opencl_icd ? 'MesaOpenCL' : 'OpenCL'