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

Fixed dynamic Beef libs on Linux/macOS

This commit is contained in:
Brian Fiete 2020-06-30 12:13:20 -07:00
parent 455a0d0b46
commit 6e5b6694a1
10 changed files with 139 additions and 34 deletions

View file

@ -313,7 +313,9 @@ namespace IDE
testProjectInfo = gApp.mTestManager.GetProjectInfo(project);
bool isExe = (project.mGeneralOptions.mTargetType != Project.TargetType.BeefLib) || (testProjectInfo != null);
if (isExe)
bool isDynLib = project.mGeneralOptions.mTargetType == Project.TargetType.BeefDynLib;
if (isExe || isDynLib)
{
CopyLibFiles(targetPath, workspaceOptions, options);
@ -335,6 +337,11 @@ namespace IDE
linkLine.Append(" ");
}*/
if (isDynLib)
{
linkLine.Append("-shared ");
}
if ((mPlatformType == .Windows) &&
((project.mGeneralOptions.mTargetType == Project.TargetType.BeefGUIApplication) ||
(project.mGeneralOptions.mTargetType == Project.TargetType.C_GUIApplication)))
@ -1092,10 +1099,8 @@ namespace IDE
absOutputDir.Append(projectBuildDir);
outputDir = absOutputDir;
targetPath.Append(outputDir, "/", project.mProjectName);
#if BF_PLATFORM_WINDOWS
targetPath.Append(".exe");
#endif
if (mPlatformType == .Windows)
targetPath.Append(".exe");
Debug.Assert(testProjectInfo.mTestExePath == null);
testProjectInfo.mTestExePath = new String(targetPath);
}

View file

@ -8337,6 +8337,8 @@ namespace IDE
bfProject.SetDisabled(false);
let platform = Workspace.PlatformType.GetFromName(mPlatformName);
var preprocessorMacros = scope DefinesSet();
void AddMacros(List<String> macros)
{
@ -8406,10 +8408,18 @@ namespace IDE
}
}
var relocType = options.mBeefOptions.mRelocType;
if (relocType == .NotSet)
{
if (platform != .Windows)
relocType = .PIC;
}
bfProject.SetOptions(targetType,
project.mBeefGlobalOptions.mStartupObject,
preprocessorMacros.mDefines,
optimizationLevel, ltoType, options.mBeefOptions.mRelocType, options.mBeefOptions.mPICLevel,
optimizationLevel, ltoType, relocType, options.mBeefOptions.mPICLevel,
options.mBeefOptions.mMergeFunctions, options.mBeefOptions.mCombineLoads,
options.mBeefOptions.mVectorizeLoops, options.mBeefOptions.mVectorizeSLP);
@ -8930,10 +8940,10 @@ namespace IDE
else if (project.mGeneralOptions.mTargetType != .CustomBuild)
newString.Append(".exe");
case .macOS:
if (project.mGeneralOptions.mTargetType == Project.TargetType.BeefLib)
if (project.mGeneralOptions.mTargetType == .BeefLib)
newString.Append(".dylib");
default:
if (project.mGeneralOptions.mTargetType == Project.TargetType.BeefLib)
if (project.mGeneralOptions.mTargetType == .BeefDynLib)
newString.Append(".so");
}
}