[build] upgrade to variant 1.1.4 and dependencies

This commit is contained in:
Konstantin Käfer
2016-11-25 16:19:07 +01:00
parent 11281d15e9
commit 4fe071b518
12 changed files with 33 additions and 21 deletions

View File

@@ -40,8 +40,8 @@ if(IS_CI_BUILD)
add_compile_options(-DCI_BUILD=1)
endif()
mason_use(geometry VERSION 0.8.0 HEADER_ONLY)
mason_use(variant VERSION 1.1.0 HEADER_ONLY)
mason_use(geometry VERSION 0.9.0 HEADER_ONLY)
mason_use(variant VERSION 1.1.4 HEADER_ONLY)
mason_use(unique_resource VERSION dev HEADER_ONLY)
mason_use(rapidjson VERSION 1.1.0 HEADER_ONLY)
mason_use(boost VERSION 1.60.0 HEADER_ONLY)
@@ -51,7 +51,7 @@ mason_use(kdbush VERSION 0.1.1 HEADER_ONLY)
mason_use(earcut VERSION 0.12.1 HEADER_ONLY)
mason_use(protozero VERSION 1.4.2 HEADER_ONLY)
mason_use(pixelmatch VERSION 0.10.0 HEADER_ONLY)
mason_use(geojson VERSION 0.3.2 HEADER_ONLY)
mason_use(geojson VERSION 0.4.0 HEADER_ONLY)
mason_use(icu VERSION 58.1)
if(WITH_COVERAGE)

View File

@@ -72,7 +72,7 @@
NSNumber *number = (NSNumber *)value;
if ((strcmp([number objCType], @encode(char)) == 0) ||
(strcmp([number objCType], @encode(BOOL)) == 0)) {
return mbglValue.get<bool>();
return uint64_t(mbglValue.get<bool>());
} else if ( strcmp([number objCType], @encode(double)) == 0 ||
strcmp([number objCType], @encode(float)) == 0) {
return mbglValue.get<double>();

View File

@@ -91,7 +91,7 @@
mbgl::Point<double> point = { -90.066667, 29.95 };
mbgl::Feature pointFeature { point };
pointFeature.id = { UINT64_MAX };
pointFeature.properties["null"] = nullptr;
pointFeature.properties["null"] = mapbox::geometry::null_value;
pointFeature.properties["bool"] = true;
pointFeature.properties["unsigned int"] = UINT64_MAX;
pointFeature.properties["int"] = INT64_MIN;

View File

@@ -82,6 +82,8 @@ endmacro()
macro(mbgl_platform_render)
set_xcode_property(mbgl-render GCC_SYMBOLS_PRIVATE_EXTERN YES)
target_link_libraries(mbgl-render
PRIVATE mbgl-loop
PRIVATE "-framework Foundation"
@@ -95,6 +97,8 @@ endmacro()
macro(mbgl_platform_offline)
set_xcode_property(mbgl-offline GCC_SYMBOLS_PRIVATE_EXTERN YES)
target_link_libraries(mbgl-offline
PRIVATE mbgl-loop
PRIVATE "-framework Foundation"
@@ -108,6 +112,8 @@ endmacro()
macro(mbgl_platform_test)
set_xcode_property(mbgl-test GCC_SYMBOLS_PRIVATE_EXTERN YES)
target_sources(mbgl-test
PRIVATE test/src/main.cpp
)
@@ -130,6 +136,8 @@ macro(mbgl_platform_test)
endmacro()
macro(mbgl_platform_benchmark)
set_xcode_property(mbgl-benchmark GCC_SYMBOLS_PRIVATE_EXTERN YES)
target_sources(mbgl-benchmark
PRIVATE benchmark/src/main.cpp
)
@@ -152,6 +160,8 @@ macro(mbgl_platform_benchmark)
endmacro()
macro(mbgl_platform_node)
set_xcode_property(mbgl-node GCC_SYMBOLS_PRIVATE_EXTERN YES)
target_link_libraries(mbgl-node
PRIVATE "-framework Foundation"
PRIVATE "-framework OpenGL"

View File

@@ -1461,6 +1461,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
HEADER_SEARCH_PATHS = (
"$(mbgl_core_INCLUDE_DIRECTORIES)",
"$(mbgl_loop_INCLUDE_DIRECTORIES)",

View File

@@ -94,9 +94,9 @@ inline optional<Value> toValue(const QVariant& value) {
} else if (value.type() == QVariant::Color) {
return { value.value<QColor>().name().toStdString() };
} else if (value.type() == QVariant::Int) {
return { value.toInt() };
return { int64_t(value.toInt()) };
} else if (value.canConvert(QVariant::Double)) {
return { value.toFloat() };
return { value.toDouble() };
} else {
return {};
}

View File

@@ -31,7 +31,7 @@ public:
FeatureType getType() const override { return type; }
optional<Value> getValue(const std::string&) const override;
optional<FeatureIdentifier> getID() const override { return { id }; }
optional<FeatureIdentifier> getID() const override { return { static_cast<uint64_t>(id) }; }
GeometryCollection getGeometries() const override { return geometries; }
const AnnotationID id;

View File

@@ -825,7 +825,8 @@ AnnotationIDs Map::queryPointAnnotations(const ScreenBox& box) {
std::set<AnnotationID> set;
for (auto &feature : features) {
assert(feature.id);
assert(*feature.id <= std::numeric_limits<AnnotationID>::max());
assert(feature.id->is<uint64_t>());
assert(feature.id->get<uint64_t>() <= std::numeric_limits<AnnotationID>::max());
set.insert(static_cast<AnnotationID>(feature.id->get<uint64_t>()));
}
AnnotationIDs ids;

View File

@@ -340,12 +340,12 @@ TEST(Annotations, QueryRenderedFeatures) {
auto features = test.map.queryRenderedFeatures(test.map.pixelForLatLng({ 0, 0 }));
EXPECT_EQ(features.size(), 1u);
EXPECT_TRUE(!!features[0].id);
EXPECT_EQ(*features[0].id, 0);
EXPECT_EQ(*features[0].id, uint64_t(0));
auto features2 = test.map.queryRenderedFeatures(test.map.pixelForLatLng({ 50, 0 }));
EXPECT_EQ(features2.size(), 1u);
EXPECT_TRUE(!!features2[0].id);
EXPECT_EQ(*features2[0].id, 1);
EXPECT_EQ(*features2[0].id, uint64_t(1));
}
TEST(Annotations, QueryFractionalZoomLevels) {

View File

@@ -104,7 +104,7 @@ inline optional<mbgl::Value> toValue(const Value& value) {
} else if (value.is<std::string>()) {
return { value.get<std::string>() };
} else if (value.is<float>()) {
return { value.get<float>() };
return { double(value.get<float>()) };
} else {
return {};
}

View File

@@ -17,7 +17,7 @@ TEST(GeoJSONOptions, Basic) {
}
TEST(GeoJSONOptions, ErrorHandling) {
ValueMap map {{"maxzoom", "should not be a string"}};
ValueMap map {{"maxzoom", std::string{"should not be a string"}}};
Value raw(map);
Result<GeoJSONOptions> converted = convert<GeoJSONOptions>(raw);
ASSERT_FALSE((bool) converted);
@@ -44,14 +44,14 @@ TEST(GeoJSONOptions, RetainsDefaults) {
TEST(GeoJSONOptions, FullConversion) {
ValueMap map {
//GeoJSON-VT
{"maxzoom", 1},
{"buffer", 2},
{"tolerance", 3},
{"maxzoom", 1.0f},
{"buffer", 2.0f},
{"tolerance", 3.0f},
//Supercluster
{"cluster", true},
{"clusterRadius", 4},
{"clusterMaxZoom", 5}
{"clusterRadius", 4.0f},
{"clusterMaxZoom", 5.0f}
};
Value raw(map);
GeoJSONOptions converted = *convert<GeoJSONOptions>(raw);

View File

@@ -42,7 +42,7 @@ TEST(Filter, EqualsNumber) {
ASSERT_FALSE(f(feature({{ "foo", std::string("0") }})));
ASSERT_FALSE(f(feature({{ "foo", false }})));
ASSERT_FALSE(f(feature({{ "foo", true }})));
ASSERT_FALSE(f(feature({{ "foo", nullptr }})));
ASSERT_FALSE(f(feature({{ "foo", mapbox::geometry::null_value }})));
ASSERT_FALSE(f(feature({{}})));
}
@@ -113,13 +113,13 @@ TEST(Filter, NotHas) {
TEST(Filter, ID) {
Feature feature1 { Point<double>() };
feature1.id = { 1234 };
feature1.id = { uint64_t(1234) };
ASSERT_TRUE(parse("[\"==\", \"$id\", 1234]")(feature1));
ASSERT_FALSE(parse("[\"==\", \"$id\", \"1234\"]")(feature1));
Feature feature2 { Point<double>() };
feature2.properties["id"] = { 1234 };
feature2.properties["id"] = { uint64_t(1234) };
ASSERT_FALSE(parse("[\"==\", \"$id\", 1234]")(feature2));
}