|
18 | 18 | resourcesFile = sys.argv[3]
|
19 | 19 | resourcesNamespace = sys.argv[4]
|
20 | 20 | guardSuffix = sys.argv[5]
|
21 |
| - isSharedLibrary = sys.argv[6] |
| 21 | + isSharedLibrary = True if sys.argv[6] == "True" else False |
22 | 22 |
|
23 | 23 | file = open(resourcesFile, 'r')
|
24 | 24 | resourcePaths = file.readlines()
|
|
37 | 37 | if isSharedLibrary:
|
38 | 38 | outp.write("#if defined(__NBL_BUILDING_TARGET__) // currently compiling the target, this define is passed through the commandline\n")
|
39 | 39 | outp.write("#if defined(_MSC_VER)\n")
|
40 |
| - outp.write("#define NBL_API2 __declspec(dllexport)\n") |
| 40 | + outp.write("#define BR_API __declspec(dllexport)\n") |
41 | 41 | outp.write("#elif defined(__GNUC__)\n")
|
42 |
| - outp.write('#define NBL_API2 __attribute__ ((visibility ("default")))' + "\n") |
| 42 | + outp.write('#define BR_API __attribute__ ((visibility ("default")))' + "\n") |
43 | 43 | outp.write("#endif\n")
|
44 | 44 | outp.write("#else\n")
|
45 | 45 | outp.write("#if defined(_MSC_VER)\n")
|
46 |
| - outp.write("#define NBL_API2 __declspec(dllimport)\n") |
| 46 | + outp.write("#define BR_API __declspec(dllimport)\n") |
47 | 47 | outp.write("#else\n")
|
48 |
| - outp.write("#define NBL_API2\n") |
| 48 | + outp.write("#define BR_API\n") |
49 | 49 | outp.write("#endif\n")
|
50 | 50 | outp.write("#endif\n\n")
|
51 | 51 |
|
52 | 52 | outp.write("namespace " + resourcesNamespace + " { \n")
|
| 53 | + |
| 54 | + if isSharedLibrary: |
| 55 | + outp.write("\t\tBR_API std::pair<const uint8_t*, size_t> get_resource_runtime(const std::string& filename);\n\n") |
| 56 | + else: |
| 57 | + outp.write("\t\tstd::pair<const uint8_t*, size_t> get_resource_runtime(const std::string& filename);\n\n") |
| 58 | + |
53 | 59 | outp.write("\t\ttemplate<nbl::core::StringLiteral Path>\n")
|
54 | 60 | outp.write("\t\tconst std::pair<const uint8_t*, size_t> get_resource();\n")
|
55 | 61 |
|
|
59 | 65 | x = itemData[0].rstrip()
|
60 | 66 |
|
61 | 67 | if isSharedLibrary:
|
62 |
| - outp.write('\n\t\ttemplate<> NBL_API2 const std::pair<const uint8_t*, size_t> get_resource<NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("%s")>();' % x) |
| 68 | + outp.write('\n\t\ttemplate<> BR_API const std::pair<const uint8_t*, size_t> get_resource<NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("%s")>();' % x) |
63 | 69 | else:
|
64 | 70 | outp.write('\n\t\ttemplate<> const std::pair<const uint8_t*, size_t> get_resource<NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("%s")>();' % x)
|
65 | 71 |
|
66 | 72 | if len(itemData) > 1:
|
67 | 73 | for i in range(1, len(itemData)):
|
68 | 74 | if isSharedLibrary:
|
69 |
| - outp.write('\n\t\ttemplate<> NBL_API2 const std::pair<const uint8_t*, size_t> get_resource<NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("%s")>();' % itemData[i].rstrip()) |
| 75 | + outp.write('\n\t\ttemplate<> BR_API const std::pair<const uint8_t*, size_t> get_resource<NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("%s")>();' % itemData[i].rstrip()) |
70 | 76 | else:
|
71 | 77 | outp.write('\n\t\ttemplate<> const std::pair<const uint8_t*, size_t> get_resource<NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("%s")>();' % itemData[i].rstrip())
|
72 | 78 |
|
|
0 commit comments