diff options
author | Leith Bade <leith@mapbox.com> | 2014-11-23 10:18:13 +1100 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2014-12-06 14:21:08 +1100 |
commit | 6df4e4a52ca0f70e7fdc5166467ab4a868e3bac5 (patch) | |
tree | df52abe9db0e2f2462b92fc322277497b388a131 /platform/ios | |
parent | ff640132de0fe855314a8fd86adae3a2fb33237b (diff) | |
download | qtlocation-mapboxgl-6df4e4a52ca0f70e7fdc5166467ab4a868e3bac5.tar.gz |
Load program binary extension on Linux
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/shader_cache_library.mm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/platform/ios/shader_cache_library.mm b/platform/ios/shader_cache_library.mm new file mode 100644 index 0000000000..68d8e959ca --- /dev/null +++ b/platform/ios/shader_cache_library.mm @@ -0,0 +1,21 @@ +#import <Foundation/Foundation.h> + +#include <mbgl/platform/platform.hpp> + +namespace mbgl { +namespace platform { + +// Returns the path to the default shader cache on this system. +std::string defaultShaderCache() { + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); + if ([paths count] == 0) { + // Disable the cache if we don't have a location to write. + return ""; + } + + NSString *libraryDirectory = [paths objectAtIndex:0]; + return [[libraryDirectory stringByAppendingPathComponent:@"shader-cache-"] UTF8String]; +} + +} +} |