diff options
author | Dylan Baker <[email protected]> | 2017-09-20 11:53:29 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2017-09-27 09:12:34 -0700 |
commit | 673dda8330769309a319d3e7f24a029cd72a1caf (patch) | |
tree | e6418ab1566d57904f24b5e85fc03f47497aaf91 /meson.build | |
parent | d1992255bb29054fa51763376d125183a9f602f3 (diff) |
meson: build "radv" vulkan driver for radeon hardware
This builds, installs, and has been tested on a r290x (Hawaii) with the Vulkan
CTS. It dies horribly in a fire at the same point for the meson build as the
autotools build.
v2: - enable radv by default
- add shader cache support and enforce that it's built for radv
v3: - Fix typo in meson_options (Nicholas)
- strip trailing 'svn' from llvm version before setting the version
preprocessor flag (Bas)
- Check for LLVM module requirements
Signed-off-by: Dylan Baker <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/meson.build b/meson.build index 0f5198bac72..5353a417484 100644 --- a/meson.build +++ b/meson.build @@ -71,6 +71,12 @@ if get_option('buildtype').startswith('debug') pre_args += '-DDEBUG' endif +if get_option('shader-cache') + pre_args += '-DENABLE_SHADER_CACHE' +elif with_amd_vk + error('Radv requires shader cache support') +endif + # Check for GCC style builtins foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect', 'ffs', 'ffsll', 'popcount', 'popcountll', 'unreachable'] @@ -79,7 +85,7 @@ foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect', 'ffs', endif endforeach -# check for GCC __attribute__ s +# check for GCC __attribute__ foreach a : ['const', 'flatten', 'malloc', 'pure', 'unused', 'warn_unused_result', 'weak',] if cc.compiles('int foo(void) __attribute__((@0@));'.format(a), @@ -286,6 +292,35 @@ dep_m = cc.find_library('m', required : false) # TODO: conditionalize libdrm requirement dep_libdrm = dependency('libdrm', version : '>= 2.4.75') pre_args += '-DHAVE_LIBDRM' +dep_libdrm_amdgpu = [] +if with_amd_vk + dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.82') +endif + +llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit'] +if with_amd_vk + llvm_modules += ['amdgpu', 'bitreader', 'ipo'] +endif +dep_llvm = dependency( + 'llvm', version : '>= 3.9.0', required : false, modules : llvm_modules, +) +if not dep_llvm.found() + if with_amd_vk + error('Radv requires llvm.') + endif +else + _llvm_version = dep_llvm.version().split('.') + # Development versions of LLVM have an 'svn' suffix, we don't want that for + # our version checks. + _llvm_patch = _llvm_version[2] + if _llvm_patch.endswith('svn') + _llvm_patch = _llvm_patch.split('s')[0] + endif + pre_args += [ + '-DHAVE_LLVM=0x0@0@@1@@2@'.format(_llvm_version[0], _llvm_version[1], _llvm_patch), + '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch), + ] +endif # TODO: make this conditional dep_valgrind = dependency('valgrind', required : false) @@ -299,8 +334,6 @@ endif # TODO: llvm-prefix and llvm-shared-libs -# TODO: llvm dependency (that's all native now, yay!) - # TODO: unwind (llvm [radeon, gallivm] and gallium) # TODO: flags for opengl, gles, dri |