Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] mason geojsonvt-2.1.6.3
Browse files Browse the repository at this point in the history
- [osx] set -fvisibility-inlines-hidden in gyp/common.gypi to silence
  mismatched visibility linker warnings
- [linux] set cxx_host in GYP_FLAGS to set -fabi-version=0 on gcc builds
  to use clang-built mason binaries
- [ios] update symbol visibility for iOS tests
- [ios] link libgeojsonvt.a in iOS tests xcodeproj
  - add libgeojsonvt.a to General -> Linked Frameworks and Libraries
  - add mason_packages (recursive) to Build Settings -> Library Search Path
- [ios] add libuv and geojsonvt first in iOS libtool smush to ensure symbols
  are found by later compilation units where they are undefined
  • Loading branch information
mikemorris committed Nov 2, 2015
1 parent ba7cc75 commit 79a5a96
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 21 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@
path = platform/ios/vendor/SMCalloutView
url = https://github.com/nfarina/calloutview.git

[submodule "src/mbgl/util/geojsonvt"]
path = src/mbgl/util/geojsonvt
url = https://github.com/mapbox/geojson-vt-cpp
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ print_flags libuv static_libs cflags ldflags
print_flags zlib static_libs cflags ldflags
print_flags nunicode static_libs cflags ldflags
print_flags libzip static_libs cflags ldflags
print_flags geojsonvt static_libs cflags ldflags
print_flags variant static_libs cflags ldflags
print_flags rapidjson static_libs cflags ldflags
print_flags gtest static_libs cflags ldflags
Expand Down
11 changes: 9 additions & 2 deletions gyp/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
'cflags_cc': [
'-Wno-unknown-pragmas', # We are using '#pragma mark', but it is only available on Darwin.
],
'conditions': [
['cxx_host != "clang"', {
'cflags_cc': [
'-fabi-version=0',
],
}],
]
}],
],
'target_conditions': [
Expand Down Expand Up @@ -84,8 +91,8 @@
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0',
'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES',
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
'DEAD_CODE_STRIPPING': 'NO',
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO',
'OTHER_CPLUSPLUSFLAGS': [ '-fno-omit-frame-pointer','-fwrapv', '-fstack-protector-all', '-fno-common']
}
},
Expand All @@ -95,8 +102,8 @@
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '3',
'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES',
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
'DEAD_CODE_STRIPPING': 'NO',
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO'
}
},
},
Expand Down
2 changes: 2 additions & 0 deletions gyp/core.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
'<@(libuv_cflags)',
'<@(opengl_cflags)',
'<@(boost_cflags)',
'<@(geojsonvt_cflags)',
'<@(variant_cflags)',
'<@(rapidjson_cflags)',
],
Expand All @@ -47,6 +48,7 @@
],
'libraries': [
'<@(libuv_static_libs)',
'<@(geojsonvt_static_libs)',
],
},

Expand Down
1 change: 1 addition & 0 deletions scripts/android/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ LIBUV_VERSION=1.7.5
ZLIB_VERSION=system
NUNICODE_VERSION=1.6
LIBZIP_VERSION=0.11.2
GEOJSONVT_VERSION=2.1.6.3
VARIANT_VERSION=1.0
RAPIDJSON_VERSION=1.0.2

Expand Down
1 change: 1 addition & 0 deletions scripts/ios/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ BOOST_VERSION=1.59.0
SQLITE_VERSION=system
LIBUV_VERSION=1.7.5
ZLIB_VERSION=system
GEOJSONVT_VERSION=2.1.6.3
VARIANT_VERSION=1.0
RAPIDJSON_VERSION=1.0.2
10 changes: 6 additions & 4 deletions scripts/ios/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,17 @@ step "Building static library..."
LIBS=(core.a platform-ios.a asset-fs.a cache-sqlite.a http-nsurl.a)
if [[ "${BUILD_FOR_DEVICE}" == true ]]; then
libtool -static -no_warning_for_no_symbols \
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libuv.a` \
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libgeojsonvt.a` \
-o ${OUTPUT}/static/lib${NAME}.a \
${LIBS[@]/#/build/${BUILDTYPE}-iphoneos/libmbgl-} \
${LIBS[@]/#/build/${BUILDTYPE}-iphonesimulator/libmbgl-} \
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libuv.a`
${LIBS[@]/#/build/${BUILDTYPE}-iphonesimulator/libmbgl-}
else
libtool -static -no_warning_for_no_symbols \
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libuv.a` \
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libgeojsonvt.a` \
-o ${OUTPUT}/static/lib${NAME}.a \
${LIBS[@]/#/build/${BUILDTYPE}-iphonesimulator/libmbgl-} \
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libuv.a`
${LIBS[@]/#/build/${BUILDTYPE}-iphonesimulator/libmbgl-}
fi
echo "Created ${OUTPUT}/static/lib${NAME}.a"

Expand Down
1 change: 1 addition & 0 deletions scripts/linux/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ LIBUV_VERSION=1.7.5
ZLIB_VERSION=system
NUNICODE_VERSION=1.6
LIBZIP_VERSION=1.0.1
GEOJSONVT_VERSION=2.1.6.3
VARIANT_VERSION=1.0
RAPIDJSON_VERSION=1.0.2
GTEST_VERSION=1.7.0
Expand Down
10 changes: 6 additions & 4 deletions scripts/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ ifneq (,$(wildcard scripts/$(HOST)/$(HOST_VERSION)/configure.sh))
CONFIGURE_FILES += scripts/$(HOST)/$(HOST_VERSION)/configure.sh
endif

ifneq (,$(findstring clang,$(CXX)))
CXX_HOST = "clang"
else ifneq (,$(findstring g++,$(CXX)))
CXX_HOST = "g++"
endif

# Text formatting
TEXT_BOLD = \033[1m
Expand All @@ -38,10 +43,6 @@ SUBMODULES += .mason/mason.sh
.mason/mason.sh:
./scripts/flock.py .git/Submodule.lock git submodule update --init .mason

SUBMODULES += src/mbgl/util/geojsonvt/geojsonvt.hpp
src/mbgl/util/geojsonvt/geojsonvt.hpp:
./scripts/flock.py .git/Submodule.lock git submodule update --init src/mbgl/util/geojsonvt

ifeq ($(HOST),ios)
SUBMODULES += platform/ios/vendor/SMCalloutView/SMCalloutView.h
platform/ios/vendor/SMCalloutView/SMCalloutView.h:
Expand Down Expand Up @@ -70,6 +71,7 @@ GYP_FLAGS += -Dcache_lib=$(CACHE)
GYP_FLAGS += -Dheadless_lib=$(HEADLESS)
GYP_FLAGS += -Dtest=$(BUILD_TEST)
GYP_FLAGS += -Drender=$(BUILD_RENDER)
GYP_FLAGS += -Dcxx_host=$(CXX_HOST)
GYP_FLAGS += --depth=.
GYP_FLAGS += -Goutput_dir=.
GYP_FLAGS += --generator-output=./build/$(HOST_SLUG)
Expand Down
1 change: 1 addition & 0 deletions scripts/osx/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ LIBUV_VERSION=1.7.5
ZLIB_VERSION=system
NUNICODE_VERSION=1.6
LIBZIP_VERSION=1.0.1
GEOJSONVT_VERSION=2.1.6.3
VARIANT_VERSION=1.0
RAPIDJSON_VERSION=1.0.2
GTEST_VERSION=1.7.0
3 changes: 0 additions & 3 deletions scripts/osx/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ BUILDTYPE=${BUILDTYPE:-Release}
# Build
################################################################################

mapbox_time "checkout_geojsonvt" \
git submodule update --init src/mbgl/util/geojsonvt

mapbox_time "compile_program" \
make xosx -j${JOBS} BUILDTYPE=${BUILDTYPE}

Expand Down
5 changes: 3 additions & 2 deletions src/mbgl/annotation/shape_annotation_impl.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <mapbox/geojsonvt/geojsonvt_convert.hpp>

#include <mbgl/annotation/shape_annotation_impl.hpp>
#include <mbgl/annotation/annotation_manager.hpp>
#include <mbgl/annotation/annotation_tile.hpp>
#include <mbgl/util/geojsonvt/geojsonvt_convert.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/string.hpp>
#include <mbgl/style/style.hpp>
Expand Down Expand Up @@ -142,7 +143,7 @@ void ShapeAnnotationImpl::updateTile(const TileID& tileID, AnnotationTile& tile)
assert(featureType != FeatureType::Unknown);

GeometryCollection renderGeometry;
for (auto& shapeGeometry : shapeFeature.geometry) {
for (auto& shapeGeometry : shapeFeature.tileGeometry) {
std::vector<Coordinate> renderLine;
auto& shapeRing = shapeGeometry.get<TileRing>();

Expand Down
3 changes: 2 additions & 1 deletion src/mbgl/annotation/shape_annotation_impl.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#ifndef MBGL_SHAPE_ANNOTATION_IMPL
#define MBGL_SHAPE_ANNOTATION_IMPL

#include <mapbox/geojsonvt/geojsonvt.hpp>

#include <mbgl/annotation/annotation.hpp>
#include <mbgl/annotation/shape_annotation.hpp>
#include <mbgl/util/geo.hpp>
#include <mbgl/util/geojsonvt/geojsonvt.hpp>

#include <memory>
#include <string>
Expand Down
1 change: 0 additions & 1 deletion src/mbgl/util/geojsonvt
Submodule geojsonvt deleted from 83bffb
9 changes: 8 additions & 1 deletion test/ios/ios-tests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
7D3A84F41BC844970041A655 /* libgeojsonvt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D3A84F31BC844970041A655 /* libgeojsonvt.a */; };
96567A231B0E84CD00D78776 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 96567A221B0E84CD00D78776 /* LaunchScreen.xib */; };
96567A311B0E8BB900D78776 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96567A301B0E8BB900D78776 /* Images.xcassets */; };
DD043363196DBBD500E6F39D /* MGLTAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DD04335F196DBBD500E6F39D /* MGLTAppDelegate.m */; };
Expand Down Expand Up @@ -74,6 +75,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
7D3A84F31BC844970041A655 /* libgeojsonvt.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgeojsonvt.a; path = "../../mason_packages/ios-9.0/geojsonvt/2.1.6/lib/libgeojsonvt.a"; sourceTree = "<group>"; };
96567A221B0E84CD00D78776 /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = SOURCE_ROOT; };
96567A301B0E8BB900D78776 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = SOURCE_ROOT; };
DACAD7111B08719F009119DC /* MGLMapboxEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGLMapboxEvents.h; path = ../../platform/ios/MGLMapboxEvents.h; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -141,6 +143,7 @@
DD41CE0D1ACB5DCB00FA7979 /* libc++.dylib in Frameworks */,
DD41CE0F1ACB5DD000FA7979 /* libsqlite3.dylib in Frameworks */,
DD41CE111ACB5DD500FA7979 /* libz.dylib in Frameworks */,
7D3A84F41BC844970041A655 /* libgeojsonvt.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -179,6 +182,7 @@
DD043325196DB9BC00E6F39D /* Frameworks */ = {
isa = PBXGroup;
children = (
7D3A84F31BC844970041A655 /* libgeojsonvt.a */,
DD0580EF1ACB62BE00B112C9 /* CoreGraphics.framework */,
DD41CE081ACB5DBC00FA7979 /* CoreTelephony.framework */,
DD41CE161ACB5DE700FA7979 /* GLKit.framework */,
Expand Down Expand Up @@ -510,7 +514,7 @@
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down Expand Up @@ -544,6 +548,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down Expand Up @@ -572,6 +577,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
../../build/ios/pkg/static,
"../../mason_packages/**",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.${PRODUCT_NAME:rfc1034identifier}";
Expand All @@ -596,6 +602,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
../../build/ios/pkg/static,
"../../mason_packages/**",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.${PRODUCT_NAME:rfc1034identifier}";
Expand Down
2 changes: 2 additions & 0 deletions test/test.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
'<@(gtest_static_libs)',
'<@(libuv_static_libs)',
'<@(sqlite_static_libs)',
'<@(geojsonvt_static_libs)',
],
'variables': {
'cflags_cc': [
Expand All @@ -105,6 +106,7 @@
'<@(opengl_cflags)',
'<@(boost_cflags)',
'<@(sqlite_cflags)',
'<@(geojsonvt_cflags)',
'<@(variant_cflags)',
'<@(rapidjson_cflags)',
],
Expand Down

0 comments on commit 79a5a96

Please sign in to comment.