]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
make : fix MUSL Linux build (#576)
authorGeorgi Gerganov <redacted>
Wed, 22 Mar 2023 18:51:42 +0000 (20:51 +0200)
committerGitHub <redacted>
Wed, 22 Mar 2023 18:51:42 +0000 (20:51 +0200)
Makefile

index 15094a4bd4e503630b2f215a154237954d7cd94b..929d45b9e822c7a13432fe946617c6178a431b6a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,12 @@ CFLAGS   = -I.              -O3 -DNDEBUG -std=c11   -fPIC
 CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC
 LDFLAGS  =
 
+# ref: https://github.com/ggerganov/whisper.cpp/issues/37
+ifneq ($(wildcard /usr/include/musl/*),)
+       CFLAGS   += -D_POSIX_SOURCE -D_GNU_SOURCE
+       CXXFLAGS += -D_POSIX_SOURCE -D_GNU_SOURCE
+endif
+
 # OS specific
 # TODO: support Windows
 ifeq ($(UNAME_S),Linux)