From 4bf4b97381403cd2e716c8dff0aa267030c4a26c Mon Sep 17 00:00:00 2001 From: Didzis Gosko Date: Fri, 9 Feb 2024 17:26:29 +0200 Subject: [PATCH] make : add macOS deployment target option (#1839) --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 762dc65ea0f..284b0f1e9ea 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,12 @@ CFLAGS = -I. -O3 -DNDEBUG -std=c11 -fPIC CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC LDFLAGS = +ifdef MACOSX_DEPLOYMENT_TARGET + CFLAGS += -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) + CXXFLAGS += -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) + LDFLAGS += -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) +endif + # clock_gettime came in POSIX.1b (1993) # CLOCK_MONOTONIC came in POSIX.1-2001 / SUSv3 as optional # posix_memalign came in POSIX.1-2001 / SUSv3