According to Microsoft's Exec Task, it runs the specified program or command by using the specified arguments:
Command - Required String parameter.
The command(s) to run. These can be system commands, such as attrib, or an executable, such as program.exe, runprogram.bat, or setup.msi.
This parameter can contain multiple lines of commands. Alternatively, you can put multiple commands in a batch file and run it by using this parameter.
We are currently using a CustomBuild
like the following:
<CustomBuild Condition="'$(Platform)'=='Win32'" Include="rdrand.asm">
<Message>Building and assembling rdrand.asm</Message>
<Command>ml.exe /c /nologo /D_M_X86 /W3 /Cx /Zi /safeseh /Fo"$(IntDir)rdrand-x86.obj" "%(FullPath)"</Command>
<Outputs>$(IntDir)\rdrand-x86.obj;%(Outputs)</Outputs>
</CustomBuild>
We want to switch to NASM and an Exec Task because it provides a single set of sources for Windows and Linux. It also allows us to provide ASM for Windows phones and tablets when appropriate, like If NASM is not available, then we will use the standby C/C++ implementation.PMULL
and PMULL2
.
Note: we don't want the user to do anything. We don't want them to select something, and we don't want them setting defines. Asking the user to do something means we have to field user questions. We want things to "just work" for users; F5 under Visual Studio should "just work" as far as the user is concerned.
My first question is, is Exec Task the right tool for the job? My scond question is, how can we determine if nasm.exe
is available from within MSBuild? Here, "available" means its on-path so we can call it.