Skip to content

Commit cacdf4d

Browse files
committed
Fix Windows build?
By convention (and often enforced requirement), `$(OutputPath)` ends with `\`, which means that quoting it for use with `<Exec/>`: <Exec Command="whatever &quot;$(OutputPath)&quot;" /> will often result in an *invalid* command, because the `\` escapes the quote! whatever "C:\path\to\output\" # ruh roh! The fix is to instead use `$(OutputPath.OutputPath.TrimEnd('\')`, which ensures that the path does *not* end in `\`, preventing the unintentional escape usage: whatever "C:\path\to\output" # yay!
1 parent 9f8b79e commit cacdf4d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/native/native-mono.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Import Project="..\..\Configuration.props" />
1212

1313
<PropertyGroup>
14-
<OutputPath>$(NativeRuntimeOutputRootDir)mono</OutputPath>
14+
<OutputPath>$(NativeRuntimeOutputRootDir)mono\</OutputPath>
1515
<CMakeRuntimeFlavor>MonoVM</CMakeRuntimeFlavor>
1616
</PropertyGroup>
1717

src/native/native.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
<ItemGroup>
9191
<_ConfigureArchiveDSOStubCommands Include="@(AndroidSupportedTargetJitAbi)">
9292
<Command>$(CmakePath)</Command>
93-
<Arguments>-DOUTPUT_PATH="$(OutputPath)" -DRUNTIME_FLAVOR="$(CMakeRuntimeFlavor)" --preset default-release-%(AndroidSupportedTargetJitAbi.Identity) -DBUILD_ARCHIVE_DSO_STUB=ON -DSTRIP_DEBUG=ON "$(MSBuildThisFileDirectory)"</Arguments>
93+
<Arguments>-DOUTPUT_PATH="$(OutputPath.TrimEnd('\')" -DRUNTIME_FLAVOR="$(CMakeRuntimeFlavor)" --preset default-release-%(AndroidSupportedTargetJitAbi.Identity) -DBUILD_ARCHIVE_DSO_STUB=ON -DSTRIP_DEBUG=ON "$(MSBuildThisFileDirectory)"</Arguments>
9494
<WorkingDirectory>$(FlavorIntermediateOutputPath)%(AndroidSupportedTargetJitAbi.AndroidRID)-archive-dso-stub</WorkingDirectory>
9595
</_ConfigureArchiveDSOStubCommands>
9696
</ItemGroup>
@@ -113,7 +113,7 @@
113113
<_NoInline Condition=" '$(DoNotInlineMonodroid)' == 'true' ">-DDONT_INLINE=ON</_NoInline>
114114
<_NoStrip Condition=" '$(DoNotStripMonodroid)' == 'true' ">-DSTRIP_DEBUG=OFF</_NoStrip>
115115

116-
<_CmakeAndroidFlags>-DOUTPUT_PATH="$(OutputPath)" -DRUNTIME_FLAVOR="$(CMakeRuntimeFlavor)" $(_NoInline) $(_NoStrip) "$(MSBuildThisFileDirectory)"</_CmakeAndroidFlags>
116+
<_CmakeAndroidFlags>-DOUTPUT_PATH="$(OutputPath.TrimEnd('\')" -DRUNTIME_FLAVOR="$(CMakeRuntimeFlavor)" $(_NoInline) $(_NoStrip) "$(MSBuildThisFileDirectory)"</_CmakeAndroidFlags>
117117
</PropertyGroup>
118118

119119
<ItemGroup>

0 commit comments

Comments
 (0)