Skip to content

Commit

Permalink
Improve build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
silviucpp committed Feb 12, 2022
1 parent 798866a commit 2fe86c6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
### Changelog:

##### v4.0.6

- Improve build scripts

##### v4.0.5

- Fix compilation error under elixir 1.13
Expand Down
3 changes: 2 additions & 1 deletion build_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if [ -d "$DEPS_LOCATION" ]; then
exit 0
fi

CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu`
OS=$(uname -s)
if [ -x "$(command -v lsb_release)" ]; then
KERNEL=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
Expand Down Expand Up @@ -95,5 +96,5 @@ popd
mkdir -p $DEPS_LOCATION/cpp-driver/build
pushd $DEPS_LOCATION/cpp-driver/build
cmake .. -DCASS_BUILD_STATIC=ON -DCMAKE_BUILD_TYPE=RELEASE
make -j 12
make -j $CPUS
popd
6 changes: 4 additions & 2 deletions c_src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ include nif.mk

ifeq ($(UNAME_SYS), darwin)

CXXFLAGS += -I/usr/local/opt/openssl/include \
OPENSSL_ROOT := $(shell brew --prefix [email protected])

CXXFLAGS += -I$(OPENSSL_ROOT)/include \
-I/usr/local/include \

LDFLAGS += -L/usr/local/opt/openssl/lib \
LDFLAGS += -L$(OPENSSL_ROOT)/lib \
-L/usr/local/lib \
-Wl,-U,_enif_alloc \
-Wl,-U,_enif_free \
Expand Down
6 changes: 3 additions & 3 deletions c_src/nif.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ UNAME_SYS = $(shell echo $(UNAME_SYS_ORG) | tr A-Z a-z)

ifeq ($(UNAME_SYS), darwin)
CC ?= cc
CFLAGS ?= -O3 -std=c99 -arch x86_64 -finline-functions -Wall
CXXFLAGS ?= -O3 -arch x86_64 -Wall
LDFLAGS ?= -arch x86_64
CFLAGS ?= -O3 -std=c99 -finline-functions -Wall
CXXFLAGS ?= -O3 -Wall
LDFLAGS ?=
else ifeq ($(UNAME_SYS), freebsd)
CC ?= cc
CFLAGS ?= -O3 -std=c99 -finline-functions -Wall
Expand Down
2 changes: 1 addition & 1 deletion src/erlcass.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{description, "ErlCass - Erlang Cassandra Driver"},
{licenses, ["MIT"]},
{links,[{"Github","https://github.com/silviucpp/erlcass"}]},
{vsn, "4.0.5"},
{vsn, "4.0.6"},
{registered, []},
{applications, [kernel, stdlib, lager]},
{mod, {erlcass_app, []}},
Expand Down

0 comments on commit 2fe86c6

Please sign in to comment.