Skip to content

Commit

Permalink
On macOS, don't build native GUI if XCode is not installed.
Browse files Browse the repository at this point in the history
MacOS has two way to install tools you need to develop (make, git, cc, ...).
Either install Xcode or something called Command Line Tools.
But the Command Line Tools version doesn't include all the necessary programs to build Apple applications.
For example xcodebuild, which if invoked without XCode installed will tell that xcode is not installed and
exit with an non 0 exit code.
  • Loading branch information
EruEri committed Jun 10, 2024
1 parent 35a7fe8 commit bb6d51e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Makefile.OCaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ endif

.PHONY: macuimaybe
ifeq ($(OSARCH), Darwin)
macuimaybe: macui
# If XCode is not installed, xcodebuild is just a placeholder telling that XCode is not installed
# and any invocation of xcodebuild results in a non 0 exit code.
ifeq ($(shell xcodebuild -version > /dev/null; echo $$?), 0)
macuimaybe: macui
else
macuimaybe:
$(info Not building macOS native GUI because XCode is not installed.)
endif
else
macuimaybe:
$(info Not on macOS. macOS native GUI will not be built.)
Expand Down

0 comments on commit bb6d51e

Please sign in to comment.