Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ else()
endif()

set(BOOST_HAS_SYSTEM false)
set(BOOST_HAS_THROW_EXCEPTION false)

find_package(Boost 1.89 QUIET COMPONENTS filesystem program_options)

if(NOT Boost_FOUND)
if(Boost_FOUND)
find_package(Boost 1.89 QUIET COMPONENTS throw_exception)
if(TARGET Boost::throw_exception)
set(BOOST_HAS_THROW_EXCEPTION true)
endif()
else()
find_package(Boost 1.66 REQUIRED COMPONENTS system filesystem program_options)
set(BOOST_HAS_SYSTEM true)
endif()
Expand Down Expand Up @@ -150,6 +156,9 @@ target_link_libraries(tilemaker
if(BOOST_HAS_SYSTEM)
target_link_libraries(tilemaker Boost::system)
endif()
if(BOOST_HAS_THROW_EXCEPTION)
target_link_libraries(tilemaker Boost::throw_exception)
endif()

include(CheckCxxAtomic)
if(NOT HAVE_CXX11_ATOMIC)
Expand All @@ -162,5 +171,8 @@ install(FILES docs/man/tilemaker.1 DESTINATION share/man/man1)
add_executable(tilemaker-server server/server.cpp)
target_include_directories(tilemaker-server PRIVATE include)
target_link_libraries(tilemaker-server ${THREAD_LIB} ${CMAKE_DL_LIBS} SQLite::SQLite3 Boost::filesystem Boost::program_options)
if(BOOST_HAS_THROW_EXCEPTION)
target_link_libraries(tilemaker-server Boost::throw_exception)
endif()

install(TARGETS tilemaker tilemaker-server RUNTIME DESTINATION bin)
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ MANPREFIX := /usr/share/man
TM_VERSION ?= $(shell git describe --tags --abbrev=0)
CXXFLAGS ?= -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c++14 -pthread -fPIE -DTM_VERSION=$(TM_VERSION) $(CONFIG)
CFLAGS ?= -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c99 -fPIE -DTM_VERSION=$(TM_VERSION) $(CONFIG)
LIB := -L$(PLATFORM_PATH)/lib -Wl,-rpath,$(PLATFORM_PATH)/lib $(LUA_LIBS) -lboost_program_options -lsqlite3 -lboost_filesystem -lboost_system -lshp -pthread
BOOST_SYSTEM_LIB := $(shell printf 'int main(){return 0;}\n' | $(CXX) -x c++ - -o /tmp/tilemaker-boost-system-check -lboost_system >/dev/null 2>&1 && echo -lboost_system; rm -f /tmp/tilemaker-boost-system-check)
LIB := -L$(PLATFORM_PATH)/lib -Wl,-rpath,$(PLATFORM_PATH)/lib $(LUA_LIBS) -lboost_program_options -lsqlite3 -lboost_filesystem $(BOOST_SYSTEM_LIB) -lshp -pthread
INC := -I$(PLATFORM_PATH)/include -isystem ./include -I./src $(LUA_CFLAGS)

# Targets
Expand Down
1 change: 1 addition & 0 deletions include/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#ifndef _HELPERS_H
#define _HELPERS_H

#include <cstdint>
#include <sstream>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion include/output_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class OutputObject {
uint_least8_t l,
NodeID id,
AttributeIndex attributes,
uint mz
unsigned int mz
):
objectID(id),
geomType(type),
Expand Down