]> git.saurik.com Git - apple/dyld.git/blob - interlinked-dylibs/MultiCacheBuilder.h
cd29ebdbd707ee64274bdc660cf2a36e9574e76f
[apple/dyld.git] / interlinked-dylibs / MultiCacheBuilder.h
1 //
2 // MultiCacheBuilder.h
3 // dyld
4 //
5 // Created by Louis Gerbarg on 6/16/15.
6 //
7 //
8
9 #ifndef MultiCacheBuilder_h
10 #define MultiCacheBuilder_h
11
12 #include <dispatch/dispatch.h>
13
14 #include "Manifest.h"
15
16 #include "mega-dylib-utils.h"
17 #include <stdlib.h>
18
19 typedef struct _BOMBom* BOMBom;
20
21 struct MultiCacheBuilder {
22 dispatch_semaphore_t _concurrencyLimitingSemaphore;
23 dispatch_semaphore_t _writeLimitingSemaphore;
24 dispatch_queue_t _writeQueue;
25 dispatch_group_t _writeGroup;
26 dispatch_queue_t _buildQueue;
27 Manifest& _manifest;
28
29 uint64_t _filesWritten = 0;
30 uint64_t _bytesWritten = 0;
31 const bool _bniMode;
32 const bool _skipWrites;
33 const bool _skipBuilds;
34 const bool _buildRoot;
35 const bool _enforceRootless;
36
37 MultiCacheBuilder(Manifest& manifest, bool BNI = false, bool SW = false, bool buildRoot = false, bool skipBuilds = false, bool enforceRootless = false);
38
39 void buildCaches(std::string masterDstRoot);
40
41 void logStats();
42 private:
43 void buildCache(const std::string cachePath, const std::set<std::string> configurations, const std::string architecture, bool development);
44 void write_cache(std::string cachePath, const std::set<std::string>& configurations, const std::string& architecture, std::shared_ptr<SharedCache> cache, bool developmentCache);
45 };
46
47 #endif /* MultiCacheBuilder_h */