[build] update Boost to 1.69 and remove RTTI

This commit is contained in:
Konstantin Käfer
2019-03-13 18:35:29 +01:00
parent e9805b60ee
commit 979433eddb
14 changed files with 146 additions and 694 deletions

View File

@@ -88,6 +88,8 @@ else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wno-variadic-macros -Wno-unknown-pragmas")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
# -Wno-error=unused-command-line-argument is required due to https://llvm.org/bugs/show_bug.cgi?id=7798
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-command-line-argument")

View File

@@ -2,6 +2,9 @@ add_executable(mbgl-glfw
platform/glfw/main.cpp
)
# args requires RTTI
set_source_files_properties(platform/glfw/main.cpp PROPERTIES COMPILE_OPTIONS "-frtti")
target_sources(mbgl-glfw
PRIVATE platform/glfw/glfw_view.hpp
PRIVATE platform/glfw/glfw_view.cpp

View File

@@ -2,6 +2,9 @@ add_executable(mbgl-offline
bin/offline.cpp
)
# args requires RTTI
set_source_files_properties(bin/offline.cpp PROPERTIES COMPILE_OPTIONS "-frtti")
target_sources(mbgl-offline
PRIVATE platform/default/include/mbgl/util/default_styles.hpp
)

View File

@@ -2,6 +2,9 @@ add_executable(mbgl-render
bin/render.cpp
)
# args requires RTTI
set_source_files_properties(bin/render.cpp PROPERTIES COMPILE_OPTIONS "-frtti")
target_include_directories(mbgl-render
PRIVATE platform/default/include
)

View File

@@ -76,7 +76,7 @@ android {
cmake {
arguments "-DANDROID_TOOLCHAIN=clang"
arguments "-DANDROID_STL=" + stl
arguments "-DANDROID_CPP_FEATURES=rtti;exceptions"
arguments "-DANDROID_CPP_FEATURES=exceptions"
arguments "-DMBGL_PLATFORM=android"
arguments "-DMASON_PLATFORM=android"
arguments "-DNodeJS_EXECUTABLE=" + node

View File

@@ -3804,6 +3804,7 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_CPP_RTTI = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = "";
"GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = "";
@@ -4064,6 +4065,7 @@
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -4130,6 +4132,7 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_CPP_RTTI = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = "";
"GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = "";

View File

@@ -1933,6 +1933,7 @@
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -1997,6 +1998,7 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_CPP_RTTI = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;

31
scripts/update-boost.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -eu
pushd "$BOOST"
if [ ! -f dist/bin/bcp ]; then
# Build bcp
./bootstrap.sh
./b2 tools/bcp
fi
popd
# Extract boost modules that we need
rm -rf vendor/boost/include
mkdir -p vendor/boost/include
"$BOOST/dist/bin/bcp" --boost="$BOOST" --scan $(find {src,include,test,platform,bin} -name "*.cpp" -o -name "*.hpp") vendor/boost/include
pushd vendor/boost
VERSION=$(sed -n 's/^#define BOOST_LIB_VERSION "\([^"]*\)"$/\1/p' include/boost/version.hpp)
echo "libboost ${VERSION/_/.} for Mapbox GL Native" > README.md
git add README.md include
popd
echo "If everything works, run:"
echo ""
echo " git -C vendor/boost checkout master"
echo " git -C vendor/boost commit -m \"update boost to ${VERSION/_/.}\""
echo " git -C vendor/boost push"
echo " git add vendor/boost"
echo ""
echo "and commit."

View File

@@ -136,7 +136,6 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters, RenderSource*
continue;
}
const auto fillPatternValue = evaluated.get<FillExtrusionPattern>().constantOr(mbgl::Faded<std::basic_string<char> >{"", ""});
assert(dynamic_cast<GeometryTile*>(&tile.tile));
GeometryTile& geometryTile = static_cast<GeometryTile&>(tile.tile);
optional<ImagePosition> patternPosA = geometryTile.getPattern(fillPatternValue.from);
optional<ImagePosition> patternPosB = geometryTile.getPattern(fillPatternValue.to);

View File

@@ -147,7 +147,6 @@ void RenderFillLayer::render(PaintParameters& parameters, RenderSource*) {
}
const auto fillPatternValue = evaluated.get<FillPattern>().constantOr(Faded<std::basic_string<char>>{"", ""});
for (const RenderTile& tile : renderTiles) {
assert(dynamic_cast<GeometryTile*>(&tile.tile));
GeometryTile& geometryTile = static_cast<GeometryTile&>(tile.tile);
optional<ImagePosition> patternPosA = geometryTile.getPattern(fillPatternValue.from);
optional<ImagePosition> patternPosB = geometryTile.getPattern(fillPatternValue.to);

View File

@@ -128,7 +128,6 @@ void RenderLineLayer::render(PaintParameters& parameters, RenderSource*) {
} else if (!unevaluated.get<LinePattern>().isUndefined()) {
const auto linePatternValue = evaluated.get<LinePattern>().constantOr(Faded<std::basic_string<char>>{ "", ""});
assert(dynamic_cast<GeometryTile*>(&tile.tile));
GeometryTile& geometryTile = static_cast<GeometryTile&>(tile.tile);
const Size texsize = geometryTile.iconAtlasTexture->size;

View File

@@ -55,7 +55,7 @@ void SpriteLoader::load(const std::string& url, Scheduler& scheduler, FileSource
} else if (res.notModified) {
return;
} else if (res.noContent) {
loader->json = std::make_shared<const std::string>();
loader->json = std::make_shared<std::string>();
emitSpriteLoadedIfComplete();
} else {
// Only trigger a sprite loaded event we got new data.
@@ -70,7 +70,7 @@ void SpriteLoader::load(const std::string& url, Scheduler& scheduler, FileSource
} else if (res.notModified) {
return;
} else if (res.noContent) {
loader->image = std::make_shared<const std::string>();
loader->image = std::make_shared<std::string>();
emitSpriteLoadedIfComplete();
} else {
loader->image = res.data;

2
vendor/boost vendored

File diff suppressed because it is too large Load Diff