premake / premake-core

Premake
https://premake.github.io/
BSD 3-Clause "New" or "Revised" License
3.22k stars 620 forks source link

cppdialect / buildoptions for intellisense in VS makefile project #1226

Closed IanLilleyT closed 4 years ago

IanLilleyT commented 5 years ago

I brought this up in a different issue: #670 but not sure if anyone saw.

Basically, I want intellisense to know the cpp dialect of my code in a VS makefile project. It seems like the best place to tell it that is under Project Properties -> NMake -> Additional Options. I don't know which solution is better: doing it through cppdialector more manually through buildoptions, but support for either would be cool.

IanLilleyT commented 5 years ago

By the way, my workaround is

require "vstudio"
premake.override(premake.vstudio.vc2010.elements, "nmakeProperties", function(oldfn, cfg) 
    return table.join(oldfn(cfg), { function(cfg) 
        premake.vstudio.vc2010.element("AdditionalOptions", nil, "/std:c++17")
    end }) 
end)
tdesveauxPKFX commented 5 years ago

I'd say it should be done in the same way as with the vcxproj generation.

https://github.com/premake/premake-core/blob/00c8d53c5355326520cceb6f112f69eedbc5ec18/modules/vstudio/vs2010_vcxproj.lua#L1427-L1436