summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c97b7ce..3633193 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,18 @@ COPYCHECK_ARGS ?=
LLD ?= 0
WERROR ?= 0
+# On MacOS 10.14, use boost::filesystem, because
+# the system doesn't supply std::filesystem.
+ifneq ($(OS),Windows_NT)
+ ifeq ($(shell uname -s),Darwin)
+ MACOS_VERSION := $(shell sw_vers -productVersion | cut -d . -f 1,2)
+ ifeq ($(MACOS_VERSION),10.14)
+ USE_BOOST_FS ?= 1
+ endif
+ endif
+endif
+USE_BOOST_FS ?= 0
+
# Use clang++ if available, else use g++
ifeq ($(shell command -v clang++ >/dev/null 2>&1; echo $$?),0)
CXX := clang++
@@ -46,6 +58,11 @@ endif
LDFLAGS := -lm -ldl -lpng
+ifneq ($(USE_BOOST_FS),0)
+ CXXFLAGS += -DUSE_BOOST_FS
+ LDFLAGS += -lboost_filesystem
+endif
+
# Use LLD if available. Set LLD=0 to not use it
ifeq ($(shell command -v ld.lld >/dev/null 2>&1; echo $$?),0)
LLD := 1