using static library only in linux

This commit is contained in:
Gabriel mermelstein 2024-09-20 12:09:06 +03:00
parent 3c2df0b899
commit 36cf1d4b56
No known key found for this signature in database
GPG Key ID: 82B8134785FEAE0D

View File

@ -4,10 +4,10 @@
NEGENTROPY_ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
INCS = -I$(NEGENTROPY_ROOT) -I/opt/homebrew/include/ -I$(NEGENTROPY_ROOT)/vendor/lmdbxx/include/
ifeq ($(OS),Windows_NT)
TARGET = libnegentropy.dll
else
ifeq ($(detected_OS),Linux)
TARGET = libnegentropy.a
else
TARGET = libnegentropy.dll
endif
.PHONY: all clean install-deps precompiled-header build-lib
@ -23,11 +23,11 @@ precompiled-header:
g++ -O0 --std=c++20 -Wall -fexceptions -g $(NEGENTROPY_ROOT)negentropy.h $(INCS)
build-lib:
ifeq ($(OS),Windows_NT)
g++ -O0 -g -std=c++20 $(INCS) -shared -fPIC -o $(TARGET) $(NEGENTROPY_ROOT)negentropy_wrapper.cpp -lcrypto -lssl -L/opt/homebrew/lib/
else
ifeq ($(detected_OS),Linux)
g++ -O0 -g -std=c++20 $(INCS) -fPIC -c negentropy_wrapper.cpp
ar rcs $(TARGET) negentropy_wrapper.o
else
g++ -O0 -g -std=c++20 $(INCS) -shared -fPIC -o $(TARGET) $(NEGENTROPY_ROOT)negentropy_wrapper.cpp -lcrypto -lssl -L/opt/homebrew/lib/
endif
clean: