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 be7c790
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Makefile.OCaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,17 @@ else
$(info GUI library lablgtk not found. GTK GUI will not be built.)
endif


# 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.
.PHONY: macuimaybe
ifeq ($(OSARCH), Darwin)
macuimaybe: macui
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 be7c790

Please sign in to comment.