OSDN Git Service

meson: fix LLVM version detection when <= 3.4
authorAndres Gomez <agomez@igalia.com>
Wed, 28 Feb 2018 21:15:07 +0000 (23:15 +0200)
committerAndres Gomez <agomez@igalia.com>
Thu, 1 Mar 2018 10:16:23 +0000 (12:16 +0200)
commit98f7650add26423d1b3e871c41ae37972b835fe1
tree26dae72875ed04862078a1afa18ea68b7c5afd13
parentbc73016703f8f2815e000f1c100532cf6e13cd3c
meson: fix LLVM version detection when <= 3.4

3 digits versions in LLVM only started from 3.4.1 on.

Hence, even if you can perfectly build with an old LLVM (< 3.4.1) in
the system while not needing LLVM at all (auto), when passing through
the LLVM version detection code, meson will fail when accessing
"_llvm_version[2]" due to:

"Index 2 out of bounds of array of size 2."

v2: Properly compare LLVM version and set patch version to 0
    if < 3.4.1 (Eric).

v3: Improve the commit log explanation (Eric).

Cc: Dylan Baker <dylan@pnwbakers.com>
Cc: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
meson.build