Issues

Issue #138 open

asm or masm or other asm support.

Manu Evans
created an issue

@*anonymous:

I have some Masm file in projects. In Visual Studio 2005 or 2008, add masm.rules in <ToolFiles

Comments (4)

  1. Joshua Reisenauer

    Here is a patch to auto load masm in VS. This patches the file vs2010_vcxproj. All you need now is have all .asm files MASM included inside a new Item group.

    @@ -40,10 +40,11 @@
                vc2010.configurationProperties(cfg)
            end
    
            _p(1,'<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.props" />')
            _p(1,'<ImportGroup Label="ExtensionSettings">')
    +       _p(2,'<Import Project="$(VCTargetsPath)\\BuildCustomizations\\masm.props" />')
            _p(1,'</ImportGroup>')
    
            for cfg in project.eachconfig(prj) do
                vc2010.propertySheets(cfg)
            end
    
  2. ytoto

    Here is a patch that worked for me. Tested only on premake5 / premake-dev, VS2013 - x64 project:

    diff -r 23d8ffcc9144 src/actions/vstudio/vs2010_vcxproj.lua
    --- a/src/actions/vstudio/vs2010_vcxproj.lua    Mon Jun 02 11:35:09 2014 -0400
    +++ b/src/actions/vstudio/vs2010_vcxproj.lua    Wed Jun 04 09:32:49 2014 +0200
    @@ -479,6 +479,7 @@
        function m.files(prj)
            m.simplefilesgroup(prj, "ClInclude")
            m.compilerfilesgroup(prj)
    +       m.simplefilesgroup(prj, "MASM")
            m.simplefilesgroup(prj, "None")
            m.simplefilesgroup(prj, "ResourceCompile")
            m.customBuildFilesGroup(prj)
    @@ -603,6 +604,7 @@
                    None = {},
                    ResourceCompile = {},
                    CustomBuild = {},
    +               MASM = {},
                }
                prj.vc2010_file_groups = groups
    
    @@ -628,6 +630,8 @@
                            table.insert(groups.ClInclude, node)
                        elseif path.isresourcefile(node.name) then
                            table.insert(groups.ResourceCompile, node)
    +                   elseif path.isasmfile(node.name) then
    +                       table.insert(groups.MASM, node)
                        else
                            table.insert(groups.None, node)
                        end
    @@ -737,6 +741,7 @@
        function m.basicRuntimeChecks(cfg)
            if cfg.flags.NoRuntimeChecks then
                _p(3,'<BasicRuntimeChecks>Default</BasicRuntimeChecks>')
    +           _p(3,'<BufferSecurityCheck>false</BufferSecurityCheck>')
            end
        end
    
    @@ -954,6 +959,7 @@
        function m.import(prj)
            _p(1,'<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.targets" />')
            _p(1,'<ImportGroup Label="ExtensionTargets">')
    +       _p(2,'<Import Project="$(VCTargetsPath)\\BuildCustomizations\\masm.targets" />')
            _p(1,'</ImportGroup>')
        end
    
    @@ -968,6 +974,7 @@
        function m.importExtensionSettings(prj)
            _p(1,'<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.props" />')
            _p(1,'<ImportGroup Label="ExtensionSettings">')
    +       _p(2,'<Import Project="$(VCTargetsPath)\\BuildCustomizations\\masm.props" />')
            _p(1,'</ImportGroup>')
        end
    
    diff -r 23d8ffcc9144 src/actions/vstudio/vs2010_vcxproj_filters.lua
    --- a/src/actions/vstudio/vs2010_vcxproj_filters.lua    Mon Jun 02 11:35:09 2014 -0400
    +++ b/src/actions/vstudio/vs2010_vcxproj_filters.lua    Wed Jun 04 09:32:49 2014 +0200
    @@ -24,6 +24,7 @@
            vc2010.filters_filegroup(prj, "ClCompile")
            vc2010.filters_filegroup(prj, "ResourceCompile")
            vc2010.filters_filegroup(prj, "CustomBuild")
    +       vc2010.filters_filegroup(prj, "MASM")
    
            p.out('</Project>')
        end
    diff -r 23d8ffcc9144 src/base/path.lua
    --- a/src/base/path.lua Mon Jun 02 11:35:09 2014 -0400
    +++ b/src/base/path.lua Wed Jun 04 09:32:49 2014 +0200
    @@ -155,6 +155,10 @@
            return path.hasextension(fname, { ".h", ".hh", ".hpp", ".hxx" })
        end
    
    +   function path.isasmfile(fname)
    +       return path.hasextension(fname, { ".asm" })
    +   end
    +
    
    
     --
    

    Thank you to the premake team <3

  3. Log in to comment