NMake projects can now specify buildoptions and cppdialect
This commit is contained in:
parent
796f517511
commit
3e5e95e034
@ -184,6 +184,28 @@ command 2</NMakeBuildCommandLine>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.onCppDialect()
|
||||
cppdialect "C++14"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<NMakeOutput>$(OutDir)MyProject</NMakeOutput>
|
||||
<AdditionalOptions>/std:c++14 %(AdditionalOptions)</AdditionalOptions>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.onBuildOptions()
|
||||
buildoptions { "testing" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<NMakeOutput>$(OutDir)MyProject</NMakeOutput>
|
||||
<AdditionalOptions>testing %(AdditionalOptions)</AdditionalOptions>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Should not emit include dirs or preprocessor definitions if the project
|
||||
|
@ -267,7 +267,8 @@
|
||||
m.nmakeRebuildCommands,
|
||||
m.nmakeCleanCommands,
|
||||
m.nmakePreprocessorDefinitions,
|
||||
m.nmakeIncludeDirs
|
||||
m.nmakeIncludeDirs,
|
||||
m.additionalCompileOptions
|
||||
}
|
||||
end
|
||||
|
||||
@ -1504,7 +1505,7 @@
|
||||
|
||||
function m.additionalCompileOptions(cfg, condition)
|
||||
local opts = cfg.buildoptions
|
||||
if _ACTION == "vs2015" then
|
||||
if _ACTION == "vs2015" or vstudio.isMakefile(cfg) then
|
||||
if (cfg.cppdialect == "C++14") then
|
||||
table.insert(opts, "/std:c++14")
|
||||
elseif (cfg.cppdialect == "C++17") then
|
||||
|
Reference in New Issue
Block a user