diff options
-rw-r--r-- | gyp/platform-ios.gypi | 1 | ||||
-rw-r--r-- | gyp/platform-linux.gypi | 1 | ||||
-rw-r--r-- | gyp/platform-osx.gypi | 1 | ||||
-rw-r--r-- | include/mbgl/platform/platform.hpp | 3 | ||||
-rw-r--r-- | platform/darwin/src/application_root.mm | 18 | ||||
-rw-r--r-- | platform/default/application_root.cpp | 28 |
6 files changed, 0 insertions, 52 deletions
diff --git a/gyp/platform-ios.gypi b/gyp/platform-ios.gypi index c243e32f2b..9ed2c4e8ec 100644 --- a/gyp/platform-ios.gypi +++ b/gyp/platform-ios.gypi @@ -26,7 +26,6 @@ '../platform/default/sqlite3.cpp', '../platform/darwin/src/log_nslog.mm', '../platform/darwin/src/string_nsstring.mm', - '../platform/darwin/src/application_root.mm', '../platform/darwin/src/image.mm', '../platform/darwin/src/nsthread.mm', '../platform/darwin/src/reachability.m', diff --git a/gyp/platform-linux.gypi b/gyp/platform-linux.gypi index 8865f68e1e..6da1075909 100644 --- a/gyp/platform-linux.gypi +++ b/gyp/platform-linux.gypi @@ -14,7 +14,6 @@ '../platform/default/log_stderr.cpp', '../platform/default/string_stdlib.cpp', '../platform/default/run_loop.cpp', - '../platform/default/application_root.cpp', '../platform/default/thread.cpp', '../platform/default/image.cpp', '../platform/default/webp_reader.cpp', diff --git a/gyp/platform-osx.gypi b/gyp/platform-osx.gypi index 3659ebb46f..1530f88b82 100644 --- a/gyp/platform-osx.gypi +++ b/gyp/platform-osx.gypi @@ -25,7 +25,6 @@ '../platform/default/sqlite3.cpp', '../platform/darwin/src/log_nslog.mm', '../platform/darwin/src/string_nsstring.mm', - '../platform/darwin/src/application_root.mm', '../platform/darwin/src/image.mm', '../platform/darwin/src/nsthread.mm', '../platform/darwin/src/reachability.m', diff --git a/include/mbgl/platform/platform.hpp b/include/mbgl/platform/platform.hpp index 087ce56f95..de2585874b 100644 --- a/include/mbgl/platform/platform.hpp +++ b/include/mbgl/platform/platform.hpp @@ -15,9 +15,6 @@ std::string uppercase(const std::string &string); // Lowercase a string, potentially using platform-specific routines. std::string lowercase(const std::string &string); -// Returns the path to the root folder of the application. -const std::string &applicationRoot(); - // Makes the current thread low priority. void makeThreadLowPriority(); diff --git a/platform/darwin/src/application_root.mm b/platform/darwin/src/application_root.mm deleted file mode 100644 index d4702c7ec5..0000000000 --- a/platform/darwin/src/application_root.mm +++ /dev/null @@ -1,18 +0,0 @@ -#import <Foundation/Foundation.h> - -#include <mbgl/platform/platform.hpp> - -namespace mbgl { -namespace platform { - -// Returns the path to the root folder of the application. -const std::string &applicationRoot() { - static const std::string root = []() -> std::string { - NSString *path = [[[NSBundle mainBundle] resourceURL] path]; - return {[path cStringUsingEncoding : NSUTF8StringEncoding], - [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding]}; - }(); - return root; -} -} -} diff --git a/platform/default/application_root.cpp b/platform/default/application_root.cpp deleted file mode 100644 index 6669a049a4..0000000000 --- a/platform/default/application_root.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include <mbgl/platform/platform.hpp> - -#include <uv.h> -#include <libgen.h> - -namespace mbgl { -namespace platform { - -// Returns the path to the root folder of the application. -const std::string &applicationRoot() { - static const std::string root = []() -> std::string { - size_t max = 0; - std::string dir; - do { - // Gradually increase the length of the string in case the path was truncated. - max += 256; - dir.resize(max); - uv_exepath(const_cast<char *>(dir.data()), &max); - } while (max == dir.size()); - dir.resize(max - 1); - dir = dirname(const_cast<char *>(dir.c_str())); - return dir; - }(); - return root; -} - -} -} |