From 507ebd042beed8e903653b11c04d83a82b80fee6 Mon Sep 17 00:00:00 2001 From: Nayu Date: Sun, 9 Jun 2024 03:59:44 +0200 Subject: [PATCH] [Makefile]: Add conditional to not build the macos gui if it's not the xcode version of xcodebuild --- src/Makefile.OCaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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.)