make : enable Darwin extensions for macOS to expose RLIMIT_MEMLOCK

This commit is contained in:
Przemyslaw Pawelczyk 2023-06-28 10:16:41 +02:00
parent 50ff7aa900
commit 5e47277633

View file

@ -109,6 +109,13 @@ ifeq ($(UNAME_S),Linux)
MK_CXXFLAGS += -D_GNU_SOURCE MK_CXXFLAGS += -D_GNU_SOURCE
endif endif
# RLIMIT_MEMLOCK came in BSD, is not specified in POSIX.1,
# and on macOS its availability depends on enabling Darwin extensions
ifeq ($(UNAME_S),Darwin)
MK_CFLAGS += -D_DARWIN_C_SOURCE
MK_CXXFLAGS += -D_DARWIN_C_SOURCE
endif
ifdef LLAMA_DEBUG ifdef LLAMA_DEBUG
MK_CFLAGS += -O0 -g MK_CFLAGS += -O0 -g
MK_CXXFLAGS += -O0 -g MK_CXXFLAGS += -O0 -g