Skip to content

Commit

Permalink
Move MAPNIK_MAJOR_VERSION checks around (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
hummeltech authored Jun 5, 2024
1 parent ba0d2af commit 1f81434
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docker/centos/stream/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/
dnf --assumeyes install \
boost-devel \
cairo-devel \
cmake3 \
cmake \
gcc \
gcc-c++ \
gdal \
Expand Down
14 changes: 6 additions & 8 deletions docker/centos/stream/Dockerfile.mapnik-latest
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/
dnf --assumeyes install epel-release && \
dnf --assumeyes upgrade && \
dnf --assumeyes install \
boost1.78-devel \
boost-devel \
bzip2 \
cairo-devel \
cmake3 \
cmake \
freetype-devel \
gcc \
gcc-c++ \
Expand Down Expand Up @@ -82,9 +82,9 @@ RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/
dnf --assumeyes install epel-release && \
dnf --assumeyes upgrade && \
dnf --assumeyes install \
boost1.78-devel \
boost-devel \
cairo-devel \
cmake3 \
cmake \
freetype-devel \
gcc \
gcc-c++ \
Expand All @@ -104,6 +104,7 @@ RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/
libxml2-devel \
make \
pkg-config \
procps \
proj-devel

## Copy files from builder(s)
Expand All @@ -116,7 +117,6 @@ WORKDIR /tmp/mod_tile_build
RUN export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \
cmake -B . -S /tmp/mod_tile_src \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES:PATH=/usr/include/boost1.78 \
-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=/var \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_INSTALL_RUNSTATEDIR:PATH=/run \
Expand Down Expand Up @@ -145,9 +145,7 @@ RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/
dnf --assumeyes install epel-release && \
dnf --assumeyes upgrade && \
dnf --assumeyes install \
boost1.78-filesystem \
boost1.78-program-options \
boost1.78-regex \
boost-regex \
cairo \
gdal \
harfbuzz \
Expand Down
15 changes: 6 additions & 9 deletions src/gen_tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <dirent.h>
#include <exception>
#include <glib.h>
#include <limits.h>
#include <map>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/coord.hpp>
Expand All @@ -35,8 +34,6 @@
#include <mapnik/params.hpp>
#include <mapnik/pixel_types.hpp>
#include <mapnik/version.hpp>
#include <math.h>
#include <memory>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -46,6 +43,12 @@
#include <unistd.h>
#include <utility>

#if MAPNIK_MAJOR_VERSION >= 4
#include <mapnik/geometry/box2d.hpp>
#else
#include <mapnik/box2d.hpp>
#endif

#include "cache_expire.h"
#include "g_logger.h"
#include "gen_tile.h"
Expand All @@ -57,12 +60,6 @@
#include "request_queue.h"
#include "store.h"

#if MAPNIK_MAJOR_VERSION >= 4
#include <mapnik/geometry/box2d.hpp>
#else
#include <mapnik/box2d.hpp>
#endif

#ifndef DEG_TO_RAD
#define DEG_TO_RAD (M_PI / 180)
#endif
Expand Down
7 changes: 4 additions & 3 deletions src/parameterize_style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
* along with this program; If not, see http://www.gnu.org/licenses/.
*/

#if MAPNIK_MAJOR_VERSION < 4
#include <boost/optional.hpp>
#endif
#include <mapnik/datasource.hpp>
#include <mapnik/datasource_cache.hpp>
#include <mapnik/layer.hpp>
#include <mapnik/map.hpp>
#include <mapnik/params.hpp>
#include <mapnik/version.hpp>

#if MAPNIK_MAJOR_VERSION < 4
#include <boost/optional.hpp>
#endif

#include "g_logger.h"
#include "parameterize_style.hpp"

Expand Down
14 changes: 7 additions & 7 deletions tests/gen_tile_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <pthread.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <strings.h>
#include <sys/stat.h>
Expand All @@ -34,6 +35,12 @@
#include <tuple>
#include <unistd.h>

#if MAPNIK_MAJOR_VERSION >= 4
#include <mapnik/geometry/box2d.hpp>
#else
#include <mapnik/box2d.hpp>
#endif

#include "catch/catch.hpp"
#include "catch_test_common.hpp"
#include "config.h"
Expand All @@ -46,13 +53,6 @@
#include "renderd.h"
#include "request_queue.h"
#include "store.h"
#include "string.h"

#if MAPNIK_MAJOR_VERSION >= 4
#include <mapnik/geometry/box2d.hpp>
#else
#include <mapnik/box2d.hpp>
#endif

#define NO_QUEUE_REQUESTS 9
#define NO_TEST_REPEATS 100
Expand Down

0 comments on commit 1f81434

Please sign in to comment.