1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28: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

@ -26,7 +26,7 @@ BF_IMPORT void BF_CALLTYPE Debugger_FullReportMemory();
BF_IMPORT void BF_CALLTYPE BfCompiler_Delete(void* bfCompiler);
BF_EXPORT void BF_CALLTYPE BfCompiler_SetOptions(void* bfCompiler, void* hotProject, int hotIdx,
int machineType, int toolsetType, int simdSetting, int allocStackCount, int maxWorkerThreads,
const char* targetTriple, int toolsetType, int simdSetting, int allocStackCount, int maxWorkerThreads,
Beefy::BfCompilerOptionFlags optionFlags, const char* mallocLinkName, const char* freeLinkName);
BF_IMPORT void BF_CALLTYPE BfCompiler_ClearBuildCache(void* bfCompiler);
BF_IMPORT bool BF_CALLTYPE BfCompiler_Compile(void* bfCompiler, void* bfPassInstance, const char* outputPath);
@ -163,6 +163,14 @@ BootApp::BootApp()
mToolset = BfToolsetType_GNU;
#endif
mEmitIR = false;
#ifdef BF_PLATFORM_WINDOWS
mTargetTriple = "x86_64-pc-windows-msvc";
#elif defined BF_PLATFORM_OSX
mTargetTriple = "x86_64-apple-macosx10.14.0";
#else
mTargetTriple = "x86_64-unknown-linux-gnu";
#endif
GetConsoleColor(gConsoleFGColor, gConsoleBGColor);
}
@ -829,7 +837,7 @@ bool BootApp::Compile()
if (maxWorkerThreads <= 1)
maxWorkerThreads = 6;
BfCompiler_SetOptions(mCompiler, NULL, 0, BfMachineType_x64, mToolset, BfSIMDSetting_SSE2, 1, maxWorkerThreads, optionFlags, "malloc", "free");
BfCompiler_SetOptions(mCompiler, NULL, 0, mTargetTriple.c_str(), mToolset, BfSIMDSetting_SSE2, 1, maxWorkerThreads, optionFlags, "malloc", "free");
if (mIsCERun)
{

View file

@ -35,6 +35,7 @@ public:
FileStream mLogFile;
Verbosity mVerbosity;
BfTargetType mTargetType;
String mTargetTriple;
bool mHadCmdLine;
bool mShowedHelp;
bool mHadErrors;