mirror of
https://github.com/logos-messaging/negentropy.git
synced 2026-01-07 00:13:12 +00:00
Merge pull request #8 from waku-org/build_support_to_major_os
chore: update makefile to support on windows
This commit is contained in:
commit
a8fb7e7d74
16
cpp/Makefile
16
cpp/Makefile
@ -1,8 +1,14 @@
|
||||
# Build a shared library of negentropy
|
||||
|
||||
#TODO: Need to add compilation flags based on OS
|
||||
INCS = -I./ -I/opt/homebrew/include/ -I./vendor/lmdbxx/include/
|
||||
TARGET = libnegentropy.so
|
||||
# Define the root directory of the negentropy project; this absolute path mechanism works across all major os
|
||||
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 = negentropy.dll
|
||||
else
|
||||
TARGET = libnegentropy.so
|
||||
endif
|
||||
|
||||
.PHONY: all clean install-deps precompiled-header shared-lib
|
||||
|
||||
@ -14,10 +20,10 @@ install-deps:
|
||||
|
||||
# Generate 'negentropy.h.gch'
|
||||
precompiled-header:
|
||||
g++ -O0 --std=c++20 -Wall -fexceptions -g negentropy.h $(INCS)
|
||||
g++ -O0 --std=c++20 -Wall -fexceptions -g $(NEGENTROPY_ROOT)negentropy.h $(INCS)
|
||||
|
||||
shared-lib:
|
||||
g++ -O0 -g -std=c++20 $(INCS) -shared -fPIC -o $(TARGET) negentropy_wrapper.cpp -lcrypto -lssl -L/opt/homebrew/lib/
|
||||
g++ -O0 -g -std=c++20 $(INCS) -shared -fPIC -o $(TARGET) $(NEGENTROPY_ROOT)negentropy_wrapper.cpp -lcrypto -lssl -L/opt/homebrew/lib/
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) negentropy.h.gch libnegentropy.so
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user