diff --git a/src/Makefile.OCaml b/src/Makefile.OCaml index 3e2fdc3e3..1297168bc 100644 --- a/src/Makefile.OCaml +++ b/src/Makefile.OCaml @@ -51,6 +51,10 @@ OCAMLLIBDIR:=$(shell $(OCAMLC) -config-var standard_library) # OCAMLFIND := $(shell command -v ocamlfind 2> /dev/null) +# Any invocation of the non-Xcode version of xcodebuild will trigger an error message +# and an non 0 exit code. +XCODEBUILD := $(shell xcodebuild -version > /dev/null; echo $$?) + ifdef OCAMLFIND ifneq ($(strip $(shell $(OCAMLFIND) query lablgtk3 2> /dev/null)),) HAS_LABLGTK3=true @@ -72,7 +76,12 @@ endif .PHONY: macuimaybe ifeq ($(OSARCH), Darwin) - macuimaybe: macui + ifeq ($(XCODEBUILD), 0) + macuimaybe: macui + else + macuimaybe: + $(info Not the xcode version of xcodebuild, macOS native GUI can not be build.) + endif else macuimaybe: $(info Not on macOS. macOS native GUI will not be built.)