summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorDylan Baker <[email protected]>2019-05-22 11:01:17 -0700
committerDylan Baker <[email protected]>2019-06-27 22:12:02 +0000
commit5157a4276500c77e2210e853b262be1d1b30aedf (patch)
tree438de28db2d49f827138ba883c4bee4d9d2fda42 /src/gallium/state_trackers
parent3d3685d3548f7e4fbabafb5b3a184486a5274c23 (diff)
meson: Add support for using cmake for finding LLVM
Meson has support for using cmake as a finder for some dependencies, including LLVM. Using cmake has a lot of advantages: it needs less meson maintenance to keep working (even for llvm updates); it works more sanely for cross compiles (as llvm-config is a compiled binary not a shell script). Meson 0.51.0 also has a new generic variable getter that can be used to get information from either cmake, pkg-config, or config-tools dependencies, which is needed for cmake. We continue to support using llvm-config if you don't have cmake installed, or if cmake cannot find a suitable version. Fixes: 0d59459432cf077d768164091318af8fb1612500 ("meson: Force the use of config-tool for llvm") Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/clover/meson.build13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/clover/meson.build b/src/gallium/state_trackers/clover/meson.build
index 2ff060bf35b..8f751cbb414 100644
--- a/src/gallium/state_trackers/clover/meson.build
+++ b/src/gallium/state_trackers/clover/meson.build
@@ -1,4 +1,4 @@
-# Copyright © 2017-2018 Intel Corporation
+# Copyright © 2017-2019 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,6 +25,12 @@ 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(
@@ -43,10 +49,7 @@ 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(join_paths(
- dep_llvm.get_configtool_variable('libdir'), 'clang',
- dep_llvm.version(), 'include',
- )),
+ '-DCLANG_RESOURCE_DIR="@0@"'.format(_clang_resources),
],
dependencies : [dep_llvm, dep_elf],
override_options : clover_cpp_std,