forked from openframeworks/projectGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibraryBinary.h
More file actions
56 lines (40 loc) · 1.31 KB
/
LibraryBinary.h
File metadata and controls
56 lines (40 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include <algorithm>
#include <string>
#include <vector>
#include "ofConstants.h"
#include "defines.h"
#ifdef OFADDON_OUTPUT_JSON_DEBUG // defined in defines.h. only for dev debugging
#include "ofJson.h"
#endif
namespace fs = of::filesystem;
class LibraryBinary {
public:
LibraryBinary(){}
LibraryBinary(fs::path p);
LibraryBinary(fs::path p, std::string a, std::string t) {
path = p;
arch = a;
target = t;
}
fs::path path;
std::string arch;
std::string target;
static const std::vector<std::string> archs;
static const std::vector<std::string> targets;
#ifdef OFADDON_OUTPUT_JSON_DEBUG
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(LibraryBinary, path, arch, target)
#endif
///\ brief check if it is valid for the passed arch and target.
///\param arch the architecture to check for. An empty string means any architecture
///\param target the target to check for. An empty string means any target
///\return true if valid false otherwise
bool isValidFor(const std::string& arch, const std::string& target);
operator fs::path() const {
return path;
// return ofPathToString(path);
}
protected:
void findArch(const std::filesystem::path & path);
void findTarget(const std::filesystem::path & path);
};