Merge pull request #1534 from nickclark2016/issues/1526
Added Ability to Disable JMC in Visual Studio
This commit is contained in:
commit
c6580ff1ce
@ -97,6 +97,8 @@ return {
|
||||
-- Visual Studio 2013+ C/C++ Shared Items projects
|
||||
"vc2013/test_vcxitems.lua",
|
||||
|
||||
-- Visual Studio 2019+ C/C++ Clang Projects
|
||||
-- Visual Studio 2019+ C/C++ Projects
|
||||
"vc2019/test_compile_settings.lua",
|
||||
"vc2019/test_link.lua",
|
||||
"vc2019/test_toolset_settings.lua"
|
||||
}
|
||||
|
41
modules/vstudio/tests/vc2019/test_compile_settings.lua
Normal file
41
modules/vstudio/tests/vc2019/test_compile_settings.lua
Normal file
@ -0,0 +1,41 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_compile_settings.lua
|
||||
-- Validate compiler settings in Visual Studio 2019 C/C++ projects.
|
||||
-- Copyright (c) 2011-2020 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
local p = premake
|
||||
local suite = test.declare("vstudio_vs2019_compile_settings")
|
||||
local vc2010 = p.vstudio.vc2010
|
||||
local project = p.project
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local wks, prj
|
||||
|
||||
function suite.setup()
|
||||
p.action.set("vs2019")
|
||||
wks, prj = test.createWorkspace()
|
||||
end
|
||||
|
||||
local function prepare(platform)
|
||||
local cfg = test.getconfig(prj, "Debug", platform)
|
||||
vc2010.clCompile(cfg)
|
||||
end
|
||||
|
||||
--
|
||||
-- Check ClCompile for SupportJustMyCode
|
||||
--
|
||||
function suite.SupportJustMyCode()
|
||||
justmycode "Off"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SupportJustMyCode>false</SupportJustMyCode>
|
||||
]]
|
||||
end
|
@ -5,7 +5,7 @@
|
||||
--
|
||||
|
||||
local p = premake
|
||||
local suite = test.declare("vstudio_vs2019_compile_settings")
|
||||
local suite = test.declare("vstudio_vs2019_link")
|
||||
local vc2010 = p.vstudio.vc2010
|
||||
local project = p.project
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
--
|
||||
|
||||
local p = premake
|
||||
local suite = test.declare("vstudio_vs2019_compile_settings")
|
||||
local suite = test.declare("vstudio_vs2019_toolset_settings")
|
||||
local vc2010 = p.vstudio.vc2010
|
||||
local project = p.project
|
||||
|
||||
|
@ -365,6 +365,7 @@
|
||||
m.optimization,
|
||||
m.functionLevelLinking,
|
||||
m.intrinsicFunctions,
|
||||
m.justMyCodeDebugging,
|
||||
m.minimalRebuild,
|
||||
m.omitFramePointers,
|
||||
m.stringPooling,
|
||||
@ -2122,6 +2123,13 @@
|
||||
end
|
||||
end
|
||||
|
||||
function m.justMyCodeDebugging(cfg)
|
||||
local jmc = cfg.justmycode
|
||||
|
||||
if _ACTION >= "vs2017" and jmc == "Off" then
|
||||
m.element("SupportJustMyCode", nil, "false")
|
||||
end
|
||||
end
|
||||
|
||||
function m.keyword(prj)
|
||||
-- try to determine what kind of targets we're building here
|
||||
|
@ -1411,6 +1411,15 @@
|
||||
kind = "boolean"
|
||||
}
|
||||
|
||||
api.register {
|
||||
name = "justmycode",
|
||||
scope = "project",
|
||||
kind = "string",
|
||||
allowed = {
|
||||
"Off"
|
||||
}
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
--
|
||||
-- Field name aliases for backward compatibility
|
||||
|
@ -105,6 +105,9 @@
|
||||
},
|
||||
omitframepointer = {
|
||||
On = "/Oy"
|
||||
},
|
||||
justmycode = {
|
||||
Off = "false"
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user