Bug 1526497 - Always get clang information for bindgen. r=ted

When the build system compiler is clang, and bindgen autodetection
actually finds a different clang via llvm-config, or a different clang
was given with --with-clang-path, we do want the proper flags to be
used for that clang, so we always get the right flags for that clang
instead of trying to shortcut.

Bug 1526857 will take care of making things more proper, while this is a
quick fix to unbreak builds in some unfortunately common kind of local
setups.

Differential Revision: https://phabricator.services.mozilla.com/D19328

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-02-11 22:04:06 +00:00
Родитель 2c0ee18d6e
Коммит 8b6c5293f7
1 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -286,13 +286,10 @@ def basic_bindgen_cflags(target, is_unix, compiler_info, android_cflags, clang_p
]
# We want to pass the same base flags as we'd pass clang.
# check_compiler from toolchain.configure gives us that, but we don't need
# to use that when the compiler used for the build is already clang-based,
# in which case we can use the same flags.
if compiler_info.type in ('clang-cl', 'clang'):
info = compiler_info
else:
info = check_compiler([clang_path], 'C++', target)
# check_compiler from toolchain.configure gives us that.
# XXX: We should actually use the compiler from toolchain.configure.
# See bug 1526857.
info = check_compiler([clang_path], 'C++', target)
args += info.flags