summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-06-14 21:47:01 +0200
committerJason Wray <jason@mapbox.com>2017-07-13 00:22:54 -0400
commita5cdbb084e489751297ffdfeb98ad208cfe03054 (patch)
tree5a506b0c41e42d0e1988b63eab77db1babde8a97
parent11952db68cebf2927fc15127712072dc0043b5e4 (diff)
downloadqtlocation-mapboxgl-a5cdbb084e489751297ffdfeb98ad208cfe03054.tar.gz
[all] make default_styles header-only
-rw-r--r--cmake/glfw.cmake1
-rw-r--r--cmake/offline.cmake1
-rw-r--r--platform/default/mbgl/util/default_styles.cpp18
-rw-r--r--platform/default/mbgl/util/default_styles.hpp16
-rw-r--r--platform/ios/config.cmake1
-rw-r--r--platform/macos/config.cmake1
-rw-r--r--platform/qt/qt.cmake1
7 files changed, 8 insertions, 31 deletions
diff --git a/cmake/glfw.cmake b/cmake/glfw.cmake
index b176fbb5bc..8e001abb27 100644
--- a/cmake/glfw.cmake
+++ b/cmake/glfw.cmake
@@ -8,7 +8,6 @@ target_sources(mbgl-glfw
PRIVATE platform/glfw/settings_json.hpp
PRIVATE platform/glfw/settings_json.cpp
PRIVATE platform/default/mbgl/util/default_styles.hpp
- PRIVATE platform/default/mbgl/util/default_styles.cpp
)
# Our GL implementation is internal to mbgl-core, which causes the GL header to
diff --git a/cmake/offline.cmake b/cmake/offline.cmake
index 1ec3f61e36..c9a3349792 100644
--- a/cmake/offline.cmake
+++ b/cmake/offline.cmake
@@ -4,7 +4,6 @@ add_executable(mbgl-offline
target_sources(mbgl-offline
PRIVATE platform/default/mbgl/util/default_styles.hpp
- PRIVATE platform/default/mbgl/util/default_styles.cpp
)
target_compile_options(mbgl-offline
diff --git a/platform/default/mbgl/util/default_styles.cpp b/platform/default/mbgl/util/default_styles.cpp
deleted file mode 100644
index 5f4ca862fe..0000000000
--- a/platform/default/mbgl/util/default_styles.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <mbgl/util/default_styles.hpp>
-
-namespace mbgl {
-namespace util {
-namespace default_styles {
-
-const DefaultStyle streets = { "mapbox://styles/mapbox/streets-v10", "Streets", 10 };
-const DefaultStyle outdoors = { "mapbox://styles/mapbox/outdoors-v10", "Outdoors", 10 };
-const DefaultStyle light = { "mapbox://styles/mapbox/light-v9", "Light", 9 };
-const DefaultStyle dark = { "mapbox://styles/mapbox/dark-v9", "Dark", 9 };
-const DefaultStyle satellite = { "mapbox://styles/mapbox/satellite-v9", "Satellite", 9 };
-const DefaultStyle satelliteStreets = { "mapbox://styles/mapbox/satellite-streets-v10", "Satellite Streets", 10 };
-const DefaultStyle trafficDay = { "mapbox://styles/mapbox/traffic-day-v2", "Traffic Day", 2 };
-const DefaultStyle trafficNight = { "mapbox://styles/mapbox/traffic-night-v2", "Traffic Night", 2 };
-
-} // namespace default_styles
-} // end namespace util
-} // end namespace mbgl
diff --git a/platform/default/mbgl/util/default_styles.hpp b/platform/default/mbgl/util/default_styles.hpp
index 466102d623..43dafb8083 100644
--- a/platform/default/mbgl/util/default_styles.hpp
+++ b/platform/default/mbgl/util/default_styles.hpp
@@ -13,14 +13,14 @@ struct DefaultStyle {
const unsigned currentVersion;
};
-extern const DefaultStyle streets;
-extern const DefaultStyle outdoors;
-extern const DefaultStyle light;
-extern const DefaultStyle dark;
-extern const DefaultStyle satellite;
-extern const DefaultStyle satelliteStreets;
-extern const DefaultStyle trafficDay;
-extern const DefaultStyle trafficNight;
+constexpr const DefaultStyle streets = { "mapbox://styles/mapbox/streets-v10", "Streets", 10 };
+constexpr const DefaultStyle outdoors = { "mapbox://styles/mapbox/outdoors-v10", "Outdoors", 10 };
+constexpr const DefaultStyle light = { "mapbox://styles/mapbox/light-v9", "Light", 9 };
+constexpr const DefaultStyle dark = { "mapbox://styles/mapbox/dark-v9", "Dark", 9 };
+constexpr const DefaultStyle satellite = { "mapbox://styles/mapbox/satellite-v9", "Satellite", 9 };
+constexpr const DefaultStyle satelliteStreets = { "mapbox://styles/mapbox/satellite-streets-v10", "Satellite Streets", 10 };
+constexpr const DefaultStyle trafficDay = { "mapbox://styles/mapbox/traffic-day-v2", "Traffic Day", 2 };
+constexpr const DefaultStyle trafficNight = { "mapbox://styles/mapbox/traffic-night-v2", "Traffic Night", 2 };
const DefaultStyle orderedStyles[] = {
streets, outdoors, light, dark, satellite, satelliteStreets,
diff --git a/platform/ios/config.cmake b/platform/ios/config.cmake
index 30cfad5d4b..dbf6780c04 100644
--- a/platform/ios/config.cmake
+++ b/platform/ios/config.cmake
@@ -23,7 +23,6 @@ macro(mbgl_platform_core)
# Default styles
PRIVATE platform/default/mbgl/util/default_styles.hpp
- PRIVATE platform/default/mbgl/util/default_styles.cpp
# Offline
PRIVATE platform/default/mbgl/storage/offline.cpp
diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake
index de17dfb067..742fce2517 100644
--- a/platform/macos/config.cmake
+++ b/platform/macos/config.cmake
@@ -19,7 +19,6 @@ macro(mbgl_platform_core)
# Default styles
PRIVATE platform/default/mbgl/util/default_styles.hpp
- PRIVATE platform/default/mbgl/util/default_styles.cpp
# Offline
PRIVATE platform/default/mbgl/storage/offline.cpp
diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake
index 5133d517d4..c8567bc2f3 100644
--- a/platform/qt/qt.cmake
+++ b/platform/qt/qt.cmake
@@ -68,7 +68,6 @@ add_library(qmapboxgl SHARED
platform/qt/src/qmapboxgl.cpp
platform/qt/src/qmapboxgl_p.hpp
platform/default/mbgl/util/default_styles.hpp
- platform/default/mbgl/util/default_styles.cpp
)
# C++ app