diff options
author | Justin R. Miller <incanus@users.noreply.github.com> | 2015-03-17 20:30:23 -0700 |
---|---|---|
committer | Justin R. Miller <incanus@users.noreply.github.com> | 2015-03-17 20:30:23 -0700 |
commit | 7b996012a51956842e46ef93239107d6a96e2a18 (patch) | |
tree | 28adea4aaa0e633b82d8bb002c1e870a7a1b7baf /platform | |
parent | d47b29813e423e7e032ee0f2a5abf759272789e8 (diff) | |
parent | 3ba72da74f7c768bbd20aacfe79873bf9702a26d (diff) | |
download | qtlocation-mapboxgl-7b996012a51956842e46ef93239107d6a96e2a18.tar.gz |
Merge pull request #1012 from mapbox/1011-bundle
Look inside MapboxGL.bundle when present
Diffstat (limited to 'platform')
-rw-r--r-- | platform/darwin/asset_root.mm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/platform/darwin/asset_root.mm b/platform/darwin/asset_root.mm index 375975a84b..4dc6b58dc2 100644 --- a/platform/darwin/asset_root.mm +++ b/platform/darwin/asset_root.mm @@ -2,13 +2,22 @@ #include <mbgl/platform/platform.hpp> +@interface MGLApplicationRootBundleCanary : NSObject +@end + +@implementation MGLApplicationRootBundleCanary +@end + namespace mbgl { namespace platform { // Returns the path to the root folder of the application. const std::string &assetRoot() { static const std::string root = []() -> std::string { - NSString *path = [[[NSBundle mainBundle] resourceURL] path]; + NSString *path = [[NSBundle bundleForClass:[MGLApplicationRootBundleCanary class]] pathForResource:@"MapboxGL" ofType:@"bundle"]; + if (!path) { + path = [[[NSBundle mainBundle] resourceURL] path]; + } return {[path cStringUsingEncoding : NSUTF8StringEncoding], [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding]}; }(); |