1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Added target triple support for more useful cross compilation

This commit is contained in:
Brian Fiete 2019-10-14 17:49:10 -07:00
parent 22ec4a86b8
commit 3bf4c792d8
15 changed files with 145 additions and 124 deletions

View file

@ -8123,7 +8123,7 @@ BF_EXPORT const char* BF_CALLTYPE BfCompiler_HotResolve_Finish(BfCompiler* bfCom
}
BF_EXPORT void BF_CALLTYPE BfCompiler_SetOptions(BfCompiler* bfCompiler, BfProject* hotProject, int hotIdx,
int machineType, int toolsetType, int simdSetting, int allocStackCount, int maxWorkerThreads,
const char* targetTriple, int toolsetType, int simdSetting, int allocStackCount, int maxWorkerThreads,
BfCompilerOptionFlags optionFlags, char* mallocLinkName, char* freeLinkName)
{
BfLogSys(bfCompiler->mSystem, "BfCompiler_SetOptions\n");
@ -8135,7 +8135,15 @@ BF_EXPORT void BF_CALLTYPE BfCompiler_SetOptions(BfCompiler* bfCompiler, BfProje
options->mErrorString.Clear();
options->mHotProject = hotProject;
options->mHotCompileIdx = hotIdx;
options->mMachineType = (BfMachineType)machineType;
options->mTargetTriple = targetTriple;
if (options->mTargetTriple.StartsWith("x86_64-"))
options->mMachineType = BfMachineType_x64;
else if (options->mTargetTriple.StartsWith("i686-"))
options->mMachineType = BfMachineType_x86;
else
options->mMachineType = BfMachineType_x64; // Default
bfCompiler->mCodeGen.SetMaxThreads(maxWorkerThreads);
if (!bfCompiler->mIsResolveOnly)