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

Fix to disable VS check when VS is not required

This commit is contained in:
Brian Fiete 2021-02-06 06:55:32 -08:00
parent fc1a54c208
commit 2e4792d51e
3 changed files with 63 additions and 13 deletions

View file

@ -106,6 +106,24 @@ namespace Beefy.widgets
extension KeyCode
{
public bool IsModifier
{
get
{
switch (this)
{
case .LWin,
.RWin,
.Alt,
.Control,
.Command:
return true;
default:
return false;
}
}
}
public static Result<KeyCode> Parse(StringView str)
{
if (str.Length == 1)

View file

@ -874,9 +874,9 @@ namespace IDE
minRTModName.Insert(0, "_");
if (!is64Bit)
linkLine.Append("-libpath:\"", gApp.mInstallDir, "lib\\x86\" ", gApp.mInstallDir, "lib\\x86\\msvcrt.lib Beef", IDEApp.sRTVersionStr,"MinRT32", minRTModName, ".lib ");
linkLine.Append("-libpath:\"", gApp.mInstallDir, "lib\\x86\" \"", gApp.mInstallDir, "lib\\x86\\msvcrt.lib\" Beef", IDEApp.sRTVersionStr,"MinRT32", minRTModName, ".lib ");
else
linkLine.Append("-libpath:\"", gApp.mInstallDir, "lib\\x64\" ", gApp.mInstallDir, "lib\\x64\\msvcrt.lib Beef", IDEApp.sRTVersionStr,"MinRT64", minRTModName, ".lib ");
linkLine.Append("-libpath:\"", gApp.mInstallDir, "lib\\x64\" \"", gApp.mInstallDir, "lib\\x64\\msvcrt.lib\" Beef", IDEApp.sRTVersionStr,"MinRT64", minRTModName, ".lib ");
linkLine.Append("ntdll.lib user32.lib kernel32.lib gdi32.lib winmm.lib shell32.lib ole32.lib rpcrt4.lib version.lib comdlg32.lib -ignore:4049 -ignore:4217 ");
}
@ -1062,17 +1062,8 @@ namespace IDE
IDEUtils.AppendWithOptionalQuotes(linkLine, resOutPath);
}
let binPath = (!is64Bit) ? gApp.mSettings.mVSSettings.mBin32Path : gApp.mSettings.mVSSettings.mBin64Path;
if (binPath.IsWhiteSpace)
{
gApp.OutputErrorLine("Visual Studio tool path not configured. Check Visual Studio configuration in File\\Preferences\\Settings.");
return false;
}
String linkerPath = scope String();
linkerPath.Append(binPath);
linkerPath.Append("/link.exe");
if (workspaceOptions.mToolsetType == .LLVM)
{
linkerPath.Clear();
@ -1097,6 +1088,17 @@ namespace IDE
if ((mPlatformType == .Windows) && (!is64Bit))
linkLine.Append(" /safeseh:no");
}
else
{
let binPath = (!is64Bit) ? gApp.mSettings.mVSSettings.mBin32Path : gApp.mSettings.mVSSettings.mBin64Path;
if (binPath.IsWhiteSpace)
{
gApp.OutputErrorLine("Visual Studio tool path not configured. Check Visual Studio configuration in File\\Preferences\\Settings.");
return false;
}
linkerPath.Append(binPath);
linkerPath.Append("/link.exe");
}
if (options.mBuildOptions.mBeefLibType != .DynamicDebug)
{

View file

@ -7497,7 +7497,7 @@ namespace IDE
}
}
}
else
else if (!evt.mKeyCode.IsModifier)
{
// Not found
if (hadChordState)
@ -10411,6 +10411,36 @@ namespace IDE
#endif
}
public bool IsVisualStudioRequired
{
get
{
if (Workspace.PlatformType.GetFromName(mPlatformName) != .Windows)
return false;
var workspaceOptions = GetCurWorkspaceOptions();
if (workspaceOptions.mToolsetType != .LLVM)
return true;
for (var project in mWorkspace.mProjects)
{
if ((project.mGeneralOptions.mTargetType != .BeefConsoleApplication) &&
(project.mGeneralOptions.mTargetType != .BeefGUIApplication) &&
(project.mGeneralOptions.mTargetType != .BeefApplication_DynamicLib) &&
(project.mGeneralOptions.mTargetType != .BeefApplication_StaticLib))
{
continue;
}
var options = GetCurProjectOptions(project);
if (options == null)
continue;
if (options.mBuildOptions.mCLibType != .SystemMSVCRT)
return true;
}
return false;
}
}
protected bool Compile(CompileKind compileKind = .Normal, Project hotProject = null)
{
Debug.Assert(mBuildContext == null);
@ -10585,7 +10615,7 @@ namespace IDE
}
}
if (Workspace.PlatformType.GetFromName(mPlatformName) == .Windows)
if ((Workspace.PlatformType.GetFromName(mPlatformName) == .Windows) && (IsVisualStudioRequired))
{
if (!mSettings.mVSSettings.IsConfigured())
mSettings.mVSSettings.SetDefaults();