Bundle modified masm.props with fully qualified ml.exe call.
authorJo Shields <jo.shields@xamarin.com>
Fri, 25 Sep 2015 08:55:44 +0000 (09:55 +0100)
committerJo Shields <jo.shields@xamarin.com>
Fri, 25 Sep 2015 08:58:34 +0000 (09:58 +0100)
In some more esoteric environments (say bash.exe spawned by
jenkins-slave.exe), the _MASM target's attempts to call ml.exe fail
due to ml.exe missing from $PATH (even when it appears to be fine).

The ClCompile target doesn't suffer this issue, since it uses the
full path to CL.exe rather than assuming CL.exe is in $PATH.
Bundle a lightly patched masm.props to duplicate the ClCompile
target behaviour.

This should have no impact on you unless for some reason you're
using a different MASM to the one provided with MSVC.

msvc/libmonoutils.vcxproj
msvc/masm.fixed.props [new file with mode: 0644]

index 615183c02df569ba3905671b76a289806644ba04..939f52048d73e8025bf515d850da7fb8096683c0 100644 (file)
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
-    <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />\r
+    <Import Project=".\masm.fixed.props" />\r
   </ImportGroup>\r
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
   <ImportGroup Label="ExtensionTargets">\r
     <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
diff --git a/msvc/masm.fixed.props b/msvc/masm.fixed.props
new file mode 100644 (file)
index 0000000..4bfa792
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup
+    Condition="'$(MASMBeforeTargets)' == '' and '$(MASMAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'">
+    <MASMBeforeTargets>Midl</MASMBeforeTargets>
+    <MASMAfterTargets>CustomBuild</MASMAfterTargets>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+    <MASM>
+      <NoLogo>true</NoLogo>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <ObjectFileName>$(IntDir)%(FileName).obj</ObjectFileName>
+      <PreserveIdentifierCase>0</PreserveIdentifierCase>
+      <WarningLevel>3</WarningLevel>
+      <PackAlignmentBoundary>0</PackAlignmentBoundary>
+      <CallingConvention>0</CallingConvention>
+      <ErrorReporting>0</ErrorReporting>
+      <CommandLineTemplate Condition="'$(Platform)' == 'Win32'">"$(VCInstallDir)bin\ml.exe" /c [AllOptions] [AdditionalOptions] /Ta[Inputs]</CommandLineTemplate>
+      <CommandLineTemplate Condition="'$(Platform)' == 'X64'">"$(VCInstallDir)bin\ml64.exe" /c [AllOptions] [AdditionalOptions] /Ta[Inputs]</CommandLineTemplate>
+      <CommandLineTemplate Condition="'$(Platform)' != 'Win32' and '$(Platform)' != 'X64'">echo MASM not supported on this platform</CommandLineTemplate>
+      <ExecutionDescription>Assembling %(Identity)...</ExecutionDescription>
+    </MASM>
+  </ItemDefinitionGroup>
+</Project>