| 11079 | } |
| 11080 | |
| 11081 | static BfPlatformType GetPlatform(StringView str) |
| 11082 | { |
| 11083 | while (!str.IsEmpty()) |
| 11084 | { |
| 11085 | char c = str[str.mLength - 1]; |
| 11086 | if (((c >= '0') && (c <= '9')) || (c == '.')) |
| 11087 | str.RemoveFromEnd(1); |
| 11088 | else |
| 11089 | break; |
| 11090 | } |
| 11091 | |
| 11092 | bool hasLinux = false; |
| 11093 | |
| 11094 | for (auto elem : str.Split('-')) |
| 11095 | { |
| 11096 | if (elem == "linux") |
| 11097 | hasLinux = true; |
| 11098 | else if (elem == "windows") |
| 11099 | return BfPlatformType_Windows; |
| 11100 | else if (elem == "macosx") |
| 11101 | return BfPlatformType_macOS; |
| 11102 | else if (elem == "ios") |
| 11103 | return BfPlatformType_iOS; |
| 11104 | else if ((elem == "android") || (elem == "androideabi")) |
| 11105 | return BfPlatformType_Android; |
| 11106 | else if ((elem == "wasm32") || (elem == "wasm64")) |
| 11107 | return BfPlatformType_Wasm; |
| 11108 | } |
| 11109 | |
| 11110 | if (hasLinux) |
| 11111 | return BfPlatformType_Linux; |
| 11112 | return BfPlatformType_Unknown; |
| 11113 | } |
| 11114 | |
| 11115 | BF_EXPORT void BF_CALLTYPE BfCompiler_SetOptions(BfCompiler* bfCompiler, BfProject* hotProject, int hotIdx, |
| 11116 | const char* targetTriple, const char* targetCPU, int toolsetType, int simdSetting, int allocStackCount, int maxWorkerThreads, |
no test coverage detected