MCPcopy Create free account
hub / github.com/beefytech/Beef / GetPlatform

Function GetPlatform

IDEHelper/Compiler/BfCompiler.cpp:11081–11113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11079}
11080
11081static 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
11115BF_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,

Callers 1

BfCompiler_SetOptionsFunction · 0.85

Calls 3

IsEmptyMethod · 0.45
RemoveFromEndMethod · 0.45
SplitMethod · 0.45

Tested by

no test coverage detected