mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-22 02:06:38 +00:00
Merge pull request #222 from mapbox/debug-builds
Explict Release/Debug modes to build
This commit is contained in:
commit
b2063108b2
36
.travis.yml
36
.travis.yml
@ -4,39 +4,47 @@ sudo: false
|
||||
|
||||
matrix:
|
||||
include:
|
||||
# coverage+debug build
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: BUILDTYPE=Debug CC="clang-3.5" CXX="clang++-3.5" CXXFLAGS="--coverage" CFLAGS="--coverage" LDFLAGS="--coverage"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ]
|
||||
packages: [ 'clang-3.5', 'llvm-3.5-dev' ]
|
||||
# release+linux+g++
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: COVERAGE=gcov-4.9 CC="gcc-4.9" CXX="g++-4.9"
|
||||
env: BUILDTYPE=Release CC="gcc-4.9" CXX="g++-4.9"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: [ 'g++-4.9' ]
|
||||
# release+linux+clang++
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: CC="clang-3.5" CXX="clang++-3.5"
|
||||
env: BUILDTYPE=Release CC="clang-3.5" CXX="clang++-3.5"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ]
|
||||
packages: [ 'clang-3.5' ]
|
||||
# release+osx
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: BUILDTYPE=Release
|
||||
# debug+osx
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: BUILDTYPE=Debug
|
||||
|
||||
|
||||
install:
|
||||
- if [ -n "${COVERAGE}" ]; then
|
||||
export CXXFLAGS="--coverage -g";
|
||||
export CFLAGS="--coverage -g";
|
||||
export LDFLAGS="--coverage";
|
||||
elif [[ $(uname -s) == 'Linux' ]]; then
|
||||
export CXX=clang++;
|
||||
fi;
|
||||
- make
|
||||
- BUILDTYPE=${BUILDTYPE} make
|
||||
|
||||
script:
|
||||
- make test
|
||||
- BUILDTYPE=${BUILDTYPE} make test
|
||||
- if [ -n "${COVERAGE}" ]; then
|
||||
rm vector_tile.pb.o;
|
||||
${COVERAGE} -lp *.o;
|
||||
/usr/bin/llvm-cov-3.5 -lp *.o;
|
||||
pip install --user cpp-coveralls;
|
||||
~/.local/bin/coveralls --no-gcov -i ./ --exclude clipper --exclude vector_tile.pb.cc --exclude vector_tile.pb.h;
|
||||
~/.local/bin/coveralls --no-gcov -i ./ --exclude clipper;
|
||||
fi
|
||||
|
22
Makefile
22
Makefile
@ -1,5 +1,6 @@
|
||||
PREFIX ?= /usr/local
|
||||
MANDIR ?= $(PREFIX)/share/man/man1/
|
||||
BUILDTYPE ?= Release
|
||||
|
||||
# inherit from env if set
|
||||
CC := $(CC)
|
||||
@ -7,6 +8,15 @@ CXX := $(CXX)
|
||||
CFLAGS := $(CFLAGS)
|
||||
CXXFLAGS := $(CXXFLAGS) -std=c++11
|
||||
LDFLAGS := $(LDFLAGS)
|
||||
WARNING_FLAGS := -Wall
|
||||
RELEASE_FLAGS := -O3 -DNDEBUG
|
||||
DEBUG_FLAGS := -O0 -DDEBUG -fno-inline-functions -fno-omit-frame-pointer
|
||||
|
||||
ifeq ($(BUILDTYPE),Release)
|
||||
FINAL_FLAGS := -g $(WARNING_FLAGS) $(RELEASE_FLAGS)
|
||||
else
|
||||
FINAL_FLAGS := -g $(WARNING_FLAGS) $(DEBUG_FLAGS)
|
||||
endif
|
||||
|
||||
all: tippecanoe tippecanoe-enumerate tippecanoe-decode tile-join
|
||||
|
||||
@ -33,26 +43,26 @@ INCLUDES = -I/usr/local/include -I.
|
||||
LIBS = -L/usr/local/lib
|
||||
|
||||
tippecanoe: geojson.o jsonpull.o tile.o clip.o pool.o mbtiles.o geometry.o projection.o memfile.o clipper/clipper.o mvt.o
|
||||
$(CXX) $(PG) $(LIBS) -O3 -g -Wall $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
|
||||
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
|
||||
|
||||
tippecanoe-enumerate: enumerate.o
|
||||
$(CC) $(PG) $(LIBS) -O3 -g -Wall $(CFLAGS) -o $@ $^ $(LDFLAGS) -lsqlite3
|
||||
$(CC) $(PG) $(LIBS) $(FINAL_FLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lsqlite3
|
||||
|
||||
tippecanoe-decode: decode.o projection.o mvt.o
|
||||
$(CXX) $(PG) $(LIBS) -O3 -g -Wall $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3
|
||||
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3
|
||||
|
||||
tile-join: tile-join.o projection.o pool.o mbtiles.o mvt.o
|
||||
$(CXX) $(PG) $(LIBS) -O3 -g -Wall $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3
|
||||
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3
|
||||
|
||||
libjsonpull.a: jsonpull.o
|
||||
$(AR) rc $@ $^
|
||||
ranlib $@
|
||||
|
||||
%.o: %.c $(H)
|
||||
$(CC) $(PG) $(INCLUDES) -O3 -g -Wall $(CFLAGS) -c $<
|
||||
$(CC) $(PG) $(INCLUDES) $(FINAL_FLAGS) $(CFLAGS) -c $<
|
||||
|
||||
%.o: %.cc $(H)
|
||||
$(CXX) $(PG) $(INCLUDES) -O3 -g -Wall $(CXXFLAGS) -c $<
|
||||
$(CXX) $(PG) $(INCLUDES) $(FINAL_FLAGS) $(CXXFLAGS) -c $<
|
||||
|
||||
clean:
|
||||
rm -f tippecanoe *.o
|
||||
|
Loading…
x
Reference in New Issue
Block a user