<!--
***********************************************************************************************
WindowsDriver.arm64.targets

WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
          created a backup copy.  Incorrect changes to this file will make it
          impossible to load or build your projects from the command-line or the IDE.

This file defines the steps/targets required to build Visual C++ projects
specifically on arm 64 platforms.

Copyright (C) Microsoft Corporation. All rights reserved.
***********************************************************************************************
-->

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <!-- *******************************************************************************************
        PreProcessForMasm
       ******************************************************************************************* -->

  <Target Name="PreprocessForMasm"
          Condition="'@(MASM)' != ''"
          BeforeTargets="_MASM">

    <!-- Get Masm items that are not excluded from build -->
    <ItemGroup>
      <BuildMasm Include="@(MASM)" Condition="'%(MASM.ExcludedFromBuild)'!='true'"/>
    </ItemGroup>

    <Message Text="Inputs: @(BuildMasm)"/>
    <ItemGroup>
      <ClCompile Include="stub.c"/>
    </ItemGroup>

    <ItemGroup>
      <ClCompile>
        <PrecompiledHeaderOutputFile  Condition="'%(ClCompile.PrecompiledHeader)' == 'NotUsing' or '%(ClCompile.PrecompiledHeader)' == ''"></PrecompiledHeaderOutputFile>
        <PrecompiledHeaderOutputFile  Condition="'%(ClCompile.PrecompiledHeader)' != 'NotUsing' and '$(RunCodeAnalysisOnce)'=='true' and '%(ClCompile.PrecompiledHeader)' != ''">%(ClCompile.PrecompiledHeaderOutputFile).codeanalysis</PrecompiledHeaderOutputFile>
        <PrecompiledHeaderFile        Condition="'%(ClCompile.PrecompiledHeader)' == 'NotUsing' or '%(ClCompile.PrecompiledHeader)' == ''"></PrecompiledHeaderFile>
        <AssemblerListingLocation     Condition="'%(ClCompile.AssemblerOutput)' == 'NoListing' or '%(ClCompile.AssemblerOutput)' == ''"></AssemblerListingLocation>
        <MinimalRebuildFromTracking   Condition="'$(BuildType)' != 'Build' or '$(ForceRebuild)' == 'true'">false</MinimalRebuildFromTracking>        
      </ClCompile>
    </ItemGroup>

    <PropertyGroup>
      <CLToolArchitecture Condition="'$(CLToolArchitecture)' == ''">$(VCToolArchitecture)</CLToolArchitecture>
      <CLToolArchitecture Condition="'$(CLToolArchitecture)' == ''">$(DefaultToolArchitecture)</CLToolArchitecture>
    </PropertyGroup>

    <CL Condition="'@(BuildMasm)' != ''"
        BuildingInIDE                      ="$(BuildingInsideVisualStudio)"
        Sources                            ="@(BuildMasm)"

        AdditionalIncludeDirectories       ="%(ClCompile.AdditionalIncludeDirectories)"
        AdditionalOptions                  =""
        AdditionalUsingDirectories         ="%(ClCompile.AdditionalUsingDirectories)"
        AssemblerListingLocation           ="%(ClCompile.AssemblerListingLocation)"
        AssemblerOutput                    ="%(ClCompile.AssemblerOutput)"
        BasicRuntimeChecks                 ="%(ClCompile.BasicRuntimeChecks)"
        BrowseInformation                  ="%(ClCompile.BrowseInformation)"
        BrowseInformationFile              ="%(ClCompile.BrowseInformationFile)"
        BufferSecurityCheck                ="%(ClCompile.BufferSecurityCheck)"
        CallingConvention                  ="%(ClCompile.CallingConvention)"
        CompileAsManaged                   ="%(ClCompile.CompileAsManaged)"
        CompileAs                          ="CompileAsC"
        DebugInformationFormat             ="%(ClCompile.DebugInformationFormat)"
        DisableLanguageExtensions          ="%(ClCompile.DisableLanguageExtensions)"
        DisableSpecificWarnings            ="%(ClCompile.DisableSpecificWarnings)"
        EnableFiberSafeOptimizations       ="%(ClCompile.EnableFiberSafeOptimizations)"
        EnablePREfast                      ="%(ClCompile.EnablePREfast)"
        ErrorReporting                     ="%(ClCompile.ErrorReporting)"
        ExceptionHandling                  ="%(ClCompile.ExceptionHandling)"
        ExcludedInputPaths                 ="$(ExcludePath)"
        ExpandAttributedSource             ="%(ClCompile.ExpandAttributedSource)"
        FavorSizeOrSpeed                   ="%(ClCompile.FavorSizeOrSpeed)"
        FloatingPointExceptions            ="%(ClCompile.FloatingPointExceptions)"
        FloatingPointModel                 ="%(ClCompile.FloatingPointModel)"
        ForceConformanceInForLoopScope     ="%(ClCompile.ForceConformanceInForLoopScope)"
        ForcedUsingFiles                   ="%(ClCompile.ForcedUsingFiles)"
        FunctionLevelLinking               ="%(ClCompile.FunctionLevelLinking)"
        GenerateXMLDocumentationFiles      ="%(ClCompile.GenerateXMLDocumentationFiles)"
        IgnoreStandardIncludePath          ="%(ClCompile.IgnoreStandardIncludePath)"
        InlineFunctionExpansion            ="%(ClCompile.InlineFunctionExpansion)"
        IntrinsicFunctions                 ="%(ClCompile.IntrinsicFunctions)"
        MinimalRebuild                     ="%(ClCompile.MinimalRebuild)"
        MultiProcessorCompilation          ="%(ClCompile.MultiProcessorCompilation)"
        ObjectFileName                     ="%(ClCompile.ObjectFileName)"
        OmitDefaultLibName                 ="%(ClCompile.OmitDefaultLibName)"
        OmitFramePointers                  ="%(ClCompile.OmitFramePointers)"
        OpenMPSupport                      ="%(ClCompile.OpenMPSupport)"
        Optimization                       ="%(ClCompile.Optimization)"
        PrecompiledHeader                  ="%(ClCompile.PrecompiledHeader)"
        PrecompiledHeaderFile              ="%(ClCompile.PrecompiledHeaderFile)"
        PrecompiledHeaderOutputFile        ="%(ClCompile.PrecompiledHeaderOutputFile)"
        PreprocessKeepComments             ="%(ClCompile.PreprocessKeepComments)"
        PreprocessorDefinitions            ="%(ClCompile.PreprocessorDefinitions)"
        PreprocessSuppressLineNumbers      ="%(ClCompile.PreprocessSuppressLineNumbers)"
        PreprocessToFile                   ="true"
        ProcessorNumber                    ="%(ClCompile.ProcessorNumber)"
        ProgramDataBaseFileName            ="%(ClCompile.ProgramDataBaseFileName)"
        RuntimeLibrary                     ="%(ClCompile.RuntimeLibrary)"
        RuntimeTypeInfo                    ="%(ClCompile.RuntimeTypeInfo)"
        ShowIncludes                       ="%(ClCompile.ShowIncludes)"
        SmallerTypeCheck                   ="%(ClCompile.SmallerTypeCheck)"
        StringPooling                      ="%(ClCompile.StringPooling)"
        StructMemberAlignment              ="%(ClCompile.StructMemberAlignment)"
        SuppressStartupBanner              ="%(ClCompile.SuppressStartupBanner)"
        TreatSpecificWarningsAsErrors      ="%(ClCompile.TreatSpecificWarningsAsErrors)"
        TreatWarningAsError                ="%(ClCompile.TreatWarningAsError)"
        TreatWChar_tAsBuiltInType          ="%(ClCompile.TreatWChar_tAsBuiltInType)"
        UndefineAllPreprocessorDefinitions ="%(ClCompile.UndefineAllPreprocessorDefinitions)"
        UndefinePreprocessorDefinitions    ="%(ClCompile.UndefinePreprocessorDefinitions)"
        UseFullPaths                       ="%(ClCompile.UseFullPaths)"
        UseUnicodeForAssemblerListing      ="%(ClCompile.UseUnicodeForAssemblerListing)"
        WarningLevel                       ="%(ClCompile.WarningLevel)"
        WholeProgramOptimization           ="%(ClCompile.WholeProgramOptimization)"
        XMLDocumentationFileName           ="%(ClCompile.XMLDocumentationFileName)"

        TrackerLogDirectory                ="%(ClCompile.TrackerLogDirectory)"

        TLogReadFiles                      ="@(CLTLogReadFiles)"
        TLogWriteFiles                     ="@(CLTLogWriteFiles)"
        ToolExe                            ="$(CLToolExe)"
        ToolPath                           ="$(CLToolPath)"
        TrackFileAccess                    ="$(TrackFileAccess)"
        MinimalRebuildFromTracking         ="%(ClCompile.MinimalRebuildFromTracking)"
        ToolArchitecture                   ="$(CLToolArchitecture)"
        TrackerFrameworkPath               ="$(CLTrackerFrameworkPath)"
        TrackerSdkPath                     ="$(CLTrackerSdkPath)"
        TrackedInputFilesToIgnore	         ="@(ClNoDependencies)"

        AcceptableNonZeroExitCodes         ="%(ClCompile.AcceptableNonZeroExitCodes)"
        YieldDuringToolExecution           ="$(ClYieldDuringToolExecution)"
        >
    </CL>
    <ItemGroup>
      <ClCompile Remove="stub.c"/>
    </ItemGroup>
  </Target>
 <Import Condition="Exists('$(WDKContentRoot)build\$(WDKBuildFolder)\windowsdriver.Masm.targets')" Project="$(WDKContentRoot)build\$(WDKBuildFolder)\windowsdriver.Masm.targets"/> 
</Project>

