i2pd/Makefile.bsd

22 lines
1.0 KiB
Makefile
Raw Normal View History

2015-12-28 18:52:02 +03:00
CXX = clang++
CXXFLAGS ?= ${CXX_DEBUG} -Wall -Wextra -Wno-unused-parameter -pedantic -Wno-misleading-indentation
DEFINES = -D_GLIBCXX_USE_NANOSLEEP=1
INCFLAGS = -I/usr/include/ -I/usr/local/include/
LDFLAGS = ${LD_DEBUG} -Wl,-rpath,/usr/local/lib -L/usr/local/lib
LDLIBS = -lcrypto -lssl -lz -lpthread -lboost_system -lboost_program_options
2014-12-17 23:46:19 +03:00
## NOTE: NEEDED_CXXFLAGS is here so that custom CXXFLAGS can be specified at build time
## **without** overwriting the CXXFLAGS which we need in order to build.
## For example, when adding 'hardening flags' to the build
## (e.g. -fstack-protector-strong -Wformat -Werror=format-security), we do not want to remove
## -std=c++11. If you want to remove this variable please do so in a way that allows setting
## custom FLAGS to work at build-time.
CXXVER := $(shell $(CXX) -dumpversion)
ifeq (${CXXVER}, "4.2.1") # older clang always returned 4.2.1
2024-09-02 17:18:08 +03:00
$(error Compiler too old)
2024-09-04 20:21:13 +03:00
else ifeq ($(shell expr match ${CXXVER} "1[6-9]"),2) # clang 16 - 19
NEEDED_CXXFLAGS += -std=c++20
else
NEEDED_CXXFLAGS = -std=c++17
endif