Skip to content

Commit

Permalink
CI use boost 1.67
Browse files Browse the repository at this point in the history
  • Loading branch information
kleunen committed Feb 22, 2021
1 parent 37ac730 commit f7d9853
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,35 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential liblua5.1-0 liblua5.1-0-dev libprotobuf-dev libsqlite3-dev protobuf-compiler shapelib libshp-dev libboost-program-options-dev libboost-filesystem-dev libboost-system-dev
sudo apt-get install -y --no-install-recommends build-essential liblua5.1-0 liblua5.1-0-dev libprotobuf-dev libsqlite3-dev protobuf-compiler shapelib libshp-dev
- name: Build and install
env:
S_CFLAGS: -flto -ffunction-sections -fdata-sections
S_CXXFLAGS: -flto -ffunction-sections -fdata-sections
S_LDFLAGS: -Wl,-gc-sections
run: |
make -j 2
mkdir build
cd build
export CFLAGS=${S_CFLAGS} && export CXXFLAGS=${S_CXXFLAGS} && export LDFLAGS=${S_LDFLAGS}
BOOST_ROOT=$BOOST_ROOT_1_72_0 cmake -DTILEMAKER_USE_STATIC_BOOST=true ..
make -j
sudo make install
- name: Build openmaptiles-compatible mbtiles files of Liechtenstein
run: |
curl http://download.geofabrik.de/europe/${AREA}-latest.osm.pbf -o ${AREA}.osm.pbf
tilemaker ${AREA}.osm.pbf --config=resources/config-openmaptiles.json --process=resources/process-openmaptiles.lua --output=${AREA}.mbtiles --verbose
- name: 'Upload compiled executable'
uses: actions/upload-artifact@v2
with:
name: tilemaker
path: build/tilemaker

Github-Action:
name: Generate mbtiles with Github Action
runs-on: ubuntu-latest
Expand Down
20 changes: 17 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 2.8)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()

project(tilemaker)

OPTION(TILEMAKER_USE_STATIC_BOOST "Statically link with boost libraries" OFF)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
Expand All @@ -15,6 +17,18 @@ endif()
include_directories(include)
include_directories(${CMAKE_BINARY_DIR}) # for generated files

IF (TILEMAKER_USE_STATIC_BOOST)
MESSAGE (STATUS "Staticly linking with Boost")
SET (Boost_USE_STATIC_LIBS TRUE)
ELSE ()
MESSAGE (STATUS "Dynamically linking with Boost")
SET (Boost_USE_STATIC_LIBS FALSE)
ENDIF ()

IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ENDIF ()

find_package(Boost 1.66 REQUIRED COMPONENTS system filesystem program_options)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})

Expand All @@ -34,7 +48,6 @@ find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIR})

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)

if(MSVC)
add_definitions(-D_USE_MATH_DEFINES)
Expand All @@ -56,6 +69,7 @@ file(GLOB tilemaker_src_files
"clipper/*.cpp"
)
add_executable(tilemaker vector_tile.pb.cc osmformat.pb.cc ${tilemaker_src_files})
target_link_libraries(tilemaker ${Boost_LIBRARIES} ${PROTOBUF_LIBRARY} ${LIBSHP_LIBRARIES} ${SQLITE3_LIBRARIES} ${LUA_LIBRARIES} ${ZLIB_LIBRARY} ${THREAD_LIB})
target_link_libraries(tilemaker ${PROTOBUF_LIBRARY} ${LIBSHP_LIBRARIES} ${SQLITE3_LIBRARIES} ${LUA_LIBRARIES} ${ZLIB_LIBRARY} ${THREAD_LIB} ${CMAKE_DL_LIBS}
Boost::system Boost::filesystem Boost::program_options)

install(TARGETS tilemaker RUNTIME DESTINATION bin)
4 changes: 2 additions & 2 deletions include/sqlite_modern_cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace sqlite {

public:
friend class database;
~database_binder() {
~database_binder() noexcept(false) {
/* Will be executed if no >>op is found */
if (_stmt) {
if (sqlite3_step(_stmt) != SQLITE_DONE) {
Expand Down Expand Up @@ -548,4 +548,4 @@ namespace sqlite {
};
#pragma endregion

}
}

0 comments on commit f7d9853

Please sign in to comment.