Skip to content

Commit 72046c0

Browse files
committed
[Custom Build Steps] Fixes to get custom build steps working.
* Add quotes to executable to support spaces in paths since the quotes can't be added by the user. * Standardize the path when looking up the build step since it may be lower cased.
1 parent a0c127e commit 72046c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sharpmake.Generators/VisualStudio/Vcxproj.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public static Dictionary<string, CombinedCustomFileBuildStep> CombineCustomFileB
181181
relativeBuildStep.AdditionalInputs.Add(relativeBuildStep.Executable);
182182
// Build the command.
183183
string command = string.Format(
184-
"{0} {1}",
184+
@"""{0}"" {1}",
185185
relativeBuildStep.Executable,
186186
relativeBuildStep.ExecutableArguments
187187
);
@@ -1430,10 +1430,12 @@ IList<string> skipFiles
14301430
{
14311431
fileGenerator.Write(Template.Project.ProjectFilesCustomBuildBegin);
14321432

1433+
var standardPath = Util.PathMakeStandard(file.FileNameProjectRelative);
1434+
14331435
foreach (Project.Configuration conf in context.ProjectConfigurations)
14341436
{
14351437
CombinedCustomFileBuildStep buildStep;
1436-
if (configurationCustomFileBuildSteps[conf].TryGetValue(file.FileNameProjectRelative, out buildStep))
1438+
if (configurationCustomFileBuildSteps[conf].TryGetValue(standardPath, out buildStep))
14371439
{
14381440
using (fileGenerator.Declare("conf", conf))
14391441
using (fileGenerator.Declare("platformName", Util.GetPlatformString(conf.Platform, conf.Project, conf.Target)))

0 commit comments

Comments
 (0)