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

Fix private header includes #8147

Closed
wants to merge 13 commits into from
Closed

Fix private header includes #8147

wants to merge 13 commits into from

Conversation

jfirebaugh
Copy link
Contributor

@jfirebaugh jfirebaugh commented Feb 21, 2017

Move some includes to public include directory, avoid others.

Fixes #4647.

@mention-bot
Copy link

@jfirebaugh, thanks for your PR! By analyzing this pull request, we identified @tmpsantos, @ansis and @tmcw to be potential reviewers.

include/mbgl/util/logging.hpp
include/mbgl/util/noncopyable.hpp
include/mbgl/util/optional.hpp
include/mbgl/util/platform.hpp
include/mbgl/util/projection.hpp
include/mbgl/util/range.hpp
include/mbgl/util/rapidjson.hpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've kept this private because it requires having the RapidJSON headers present. What's the reason for making this public?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used by Qt SDK bindings, specifically

#include <mbgl/util/rapidjson.hpp>
. @tmpsantos @brunoabinader do you see a way to keep it private?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make Result<GeoJSON> convertGeoJSON(const QVariant& value) to use an overloaded version of convertGeoJSON internally that receives a std::string as input. This overloaded version could then use rapidjson to parse this and reside outside of Qt scope.

The same could be made in e.g. https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/src/style/conversion/geojson.hpp.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in f6f826d0b5d3948422b764272f388d6487559c87 e61214eaec702547a010ca6c2ca7df47ef60be02.

@@ -9,7 +9,7 @@
#include <mbgl/style/conversion/source.hpp>
#include <mbgl/style/conversion/layer.hpp>
#include <mbgl/style/conversion/filter.hpp>
#include <mbgl/sprite/sprite_image.cpp>
#include <mbgl/sprite/sprite_image.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did this ever work without duplicate symbol errors?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, right? I don't know.

src/mbgl/gl/vertex_array.cpp
src/mbgl/gl/vertex_array.hpp
src/mbgl/gl/vertex_buffer.hpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we make them public? They only seem to be used within the rendering subsystem, which isn't exposed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, #8148

@jfirebaugh
Copy link
Contributor Author

Nice, thanks @brunoabinader.

Ok, ready for a final review here.

Copy link
Contributor

@kkaefer kkaefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on #8148 so we can leave the GL headers private.

@jfirebaugh
Copy link
Contributor Author

@kkaefer #8148 seems to be stalled. Could we merge this now to avoid future merge conflicts (which are already starting to accumulate)?

@kkaefer kkaefer mentioned this pull request Mar 22, 2017
@kkaefer
Copy link
Contributor

kkaefer commented Mar 22, 2017

@jfirebaugh please see #8216 for an alternative that includes all of the commits in this PR, except for the one making the GL headers public.

@jfirebaugh
Copy link
Contributor Author

#8216

@jfirebaugh jfirebaugh closed this Mar 27, 2017
@jfirebaugh jfirebaugh deleted the private-src branch March 27, 2017 19:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants