Fix of building Infer for Objective C (#1345)

Summary:
- The SDK path is different for Objective C when command line tools for Xcode are installed without Xcode itself.
- Related issue https://github.com/facebook/infer/issues/1002.

I still have a problem with the mentioned issue. I think that it is possible that the SDK paths differs for Objective C on Mac OS when I have installed just command line tools for Xcode without Xcode itself. This change solves the issue for me. Is it a good solution? Could it be possibly added to Infer? Or is there any better way?

Pull Request resolved: https://github.com/facebook/infer/pull/1345

Reviewed By: ngorogiannis

Differential Revision: D24917636

Pulled By: jvillard

fbshipit-source-id: 534ce4b49
master
Dominik Harmim 4 years ago committed by Facebook GitHub Bot
parent f284425cb7
commit 3df3ca9eac

@ -110,6 +110,9 @@ CLANG_DEPS_NO_MODELS = $(INFER_BIN)
CLANG_DEPS = $(CLANG_DEPS_NO_MODELS) $(MODELS_RESULTS_FILE)
XCODE_ISYSROOT_SUFFIX = Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
ifeq ($(wildcard $(XCODE_BASE)/$(XCODE_ISYSROOT_SUFFIX)),)
XCODE_ISYSROOT_SUFFIX = SDKs/MacOSX.sdk
endif
ifeq ($(HAS_OBJC),yes)
XCODE_ISYSROOT = $(XCODE_BASE)/$(XCODE_ISYSROOT_SUFFIX)

@ -41,6 +41,9 @@ OCAML_CPP?=$(LOCAL_CLANG) -cc1 -E -P -x c -main-file-name - -o -
# Which SDK to use (if any)
SDKPATH?=$(shell ls -d "`xcode-select --print-path 2> /dev/null`"/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator*.sdk 2> /dev/null | sort -r | head -n 1 || true)
ifeq ($SDKPATH,)
SDKPATH?=$(shell ls -d "`xcode-select --print-path 2> /dev/null`"/SDKs/MacOSX.sdk 2> /dev/null | sort -r | head -n 1 || true)
endif
ifeq ($(SDKPATH),)
HAS_OBJC=no

Loading…
Cancel
Save