diff options
author | Dylan Baker <[email protected]> | 2019-07-25 14:27:43 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2019-10-18 13:02:58 -0700 |
commit | 821cf6942a390f5f64d8a2cff9933b24c84f7dc1 (patch) | |
tree | 381173af020b9b2ccdc8c0ef4f7515a5209c44f3 /meson.build | |
parent | b962c7c9713700ca02b698efb1dfdd28516ce580 (diff) |
meson: Use cmake to find LLVM when building for windows
We don't use cmake normally because it always results in static linking.
This is very problematic for *nix OSes which expect shared linking by
default, but for windows this isn't a problem as LLVM doesn't support
shared linking on windows anyway.
Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 2d8668e601b..00cf3e017ab 100644 --- a/meson.build +++ b/meson.build @@ -1368,8 +1368,16 @@ else endif _shared_llvm = get_option('shared-llvm') - _llvm = get_option('llvm') + +# The cmake method will never find libllvm.so|dylib; this is fine for windows +# because llvm doesn't support libllvm.dll +_llvm_method = 'config-tool' +if (meson.version().version_compare('>= 0.51.0') and + host_machine.system() == 'windows') + _llvm_method = 'cmake' +endif + dep_llvm = null_dep with_llvm = false if _llvm != 'false' @@ -1383,7 +1391,7 @@ if _llvm != 'false' with_gallium_opencl or _llvm == 'true' ), static : not _shared_llvm, - method : 'config-tool', + method : _llvm_method, fallback : ['llvm', 'dep_llvm'], ) with_llvm = dep_llvm.found() |