Commits

Anonymous committed 2a732ff

Add flag "ReleaseRuntime", add test case to it.

Comments (0)

Files changed (4)

src/actions/vstudio/vs200x_vcproj.lua

 		end
 
 		local runtime
-		if premake.config.isdebugbuild(cfg) then
+		if premake.config.isdebugbuild(cfg) and not cfg.flags.ReleaseRuntime  then
 			runtime = iif(cfg.flags.StaticRuntime, 1, 3)
 		else
 			runtime = iif(cfg.flags.StaticRuntime, 0, 2)
 			"Optimize",
 			"OptimizeSize",
 			"OptimizeSpeed",
+			"ReleaseRuntime",
 			"SEH",
 			"StaticRuntime",
 			"Symbols",

src/base/config.lua

 
 	function premake.config.isdebugbuild(cfg)
 		-- If any of the optimize flags are set, it's a release a build
-		if cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then
+		if cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed or cfg.flags.ReleaseRuntime then
 			return false
 		end
 		-- If symbols are not defined, it's a release build

tests/actions/vstudio/vc200x/test_compiler_block.lua

 		]]
 	end
 
+--
+-- Verify the correct runtime library is used when symbols are enabled.
+-- Mimic actual use case - produce release build capable of debugging.
+--
+
+	function suite.runtimeLibraryIsRelease_onSymbolsReleaseRuntime()
+		flags { "NoRuntimeChecks", "Symbols", "ReleaseRuntime", "NoEditAndContinue" }
+		prepare()
+		test.capture [[
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+		]]
+	end
+
 
 --
 -- Verify the correct warnings settings are used when ExtraWarnings are enabled.