Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Custom Build Steps] Fixes to get custom build steps working. #174

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Sharpmake.Generators/VisualStudio/Vcxproj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,17 @@ public static Dictionary<string, CombinedCustomFileBuildStep> CombineCustomFileB
foreach (var customBuildStep in buildSteps)
{
var relativeBuildStep = customBuildStep.MakePathRelative(resolver, (path, commandRelative) => Util.SimplifyPath(Util.PathGetRelative(referencePath, path)));
relativeBuildStep.AdditionalInputs.Add(relativeBuildStep.Executable);
var executable = relativeBuildStep.Executable;
if (!executable.StartsWith("\"") && !executable.EndsWith("\"") && !executable.Contains("\n"))
{
executable = string.Format("\"{0}\"", executable);
}

relativeBuildStep.AdditionalInputs.Add(executable);
// Build the command.
string command = string.Format(
"{0} {1}",
relativeBuildStep.Executable,
executable,
relativeBuildStep.ExecutableArguments
);

Expand Down Expand Up @@ -1430,10 +1436,12 @@ IList<string> skipFiles
{
fileGenerator.Write(Template.Project.ProjectFilesCustomBuildBegin);

var standardPath = Util.PathMakeStandard(file.FileNameProjectRelative);

foreach (Project.Configuration conf in context.ProjectConfigurations)
{
CombinedCustomFileBuildStep buildStep;
if (configurationCustomFileBuildSteps[conf].TryGetValue(file.FileNameProjectRelative, out buildStep))
if (configurationCustomFileBuildSteps[conf].TryGetValue(standardPath, out buildStep))
{
using (fileGenerator.Declare("conf", conf))
using (fileGenerator.Declare("platformName", Util.GetPlatformString(conf.Platform, conf.Project, conf.Target)))
Expand Down
Loading