From 1d909606aab797279174ebfe641fca32ed78e368 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Mon, 25 Apr 2016 03:11:35 -0700 Subject: [PATCH] Add option to replace path to clang internal headers Summary: Provide possibility to replace clang internal headers path if they are overwritten by `-isystem`. User needs to specify path to wrong headers to be replaced with infer's clang. Reviewed By: martinoluca Differential Revision: D3212850 fb-gh-sync-id: be3d51c fbshipit-source-id: be3d51c --- infer/lib/clang_wrappers/clang_wrapper | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/infer/lib/clang_wrappers/clang_wrapper b/infer/lib/clang_wrappers/clang_wrapper index d4a281bd6..1bd7d9680 100755 --- a/infer/lib/clang_wrappers/clang_wrapper +++ b/infer/lib/clang_wrappers/clang_wrapper @@ -8,6 +8,13 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" CLANG_COMPILER="${SCRIPT_DIR}/../../../facebook-clang-plugins/clang/bin/clang" +# WARNING: use at your own risk, not needed in most cases +# Path that points to clang internal headers to be replaced with +# path to infer's clang internal headers. +CLANG_INCLUDE_TO_REPLACE="${FCP_CLANG_INCLUDE_TO_REPLACE}" + +CLANG_LIB_INCLUDE="${SCRIPT_DIR}/../../../facebook-clang-plugins/clang/lib/clang/3.8.0/include" + if [ "${0%++}" != "$0" ]; then XX="++"; else XX=""; fi COMMAND=("${CLANG_COMPILER}${XX}") @@ -21,6 +28,8 @@ do elif [ "$X" == "armv7k" ] && [ "$PREV" == "-arch" ]; then # replace armv7k arch with armv7 COMMAND+=("armv7") + elif [ "$X" == "$CLANG_INCLUDE_TO_REPLACE" ] && [ "$PREV" == "-isystem" ]; then + COMMAND+=("$CLANG_LIB_INCLUDE") else COMMAND+=("$X") fi