diff options
author | liamDevine <none@none> | 2010-11-01 02:18:15 +0300 |
---|---|---|
committer | liamDevine <none@none> | 2010-11-01 02:18:15 +0300 |
commit | f97ddd585eb0d0d874cb204768576d82ee593f92 (patch) | |
tree | 3d08d7808ff63240485550701dbd336130125e62 | |
parent | 7d2e085343c13cac54cab687f86ae328399b371d (diff) |
Fixes vs10 Bug 3100062 uses premake.config.isdebugbuild to determine debug status
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rw-r--r-- | src/actions/vstudio/vs2010_vcxproxj.lua | 13 | ||||
-rw-r--r-- | tests/actions/vstudio/test_vs2010_flags.lua | 62 |
3 files changed, 32 insertions, 45 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index e6e03d1..9ad543a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -28,7 +28,7 @@ * Bug 3015312: Makefiles are not quoted correctly * Bug 3097868: Patch 3076517 premake_rev465.patch. Removes relative paths from vs2010 filters (Robert Konrad) * Bug 3095274: vs2010 PCH implemented and has the same behaviour as previous VS versions - +* Bug 3100062: vs2010 Runtime library selection ------- 4.2.1 ------- diff --git a/src/actions/vstudio/vs2010_vcxproxj.lua b/src/actions/vstudio/vs2010_vcxproxj.lua index 63ce397..fe65465 100644 --- a/src/actions/vstudio/vs2010_vcxproxj.lua +++ b/src/actions/vstudio/vs2010_vcxproxj.lua @@ -224,10 +224,10 @@ local vs10_helpers = premake.vstudio.vs10_helpers local function runtime(cfg) local runtime - if cfg.flags.StaticRuntime then - runtime = iif(cfg.flags.Symbols,"MultiThreadedDebug","MultiThreaded") + if premake.config.isdebugbuild(cfg) then + runtime = iif(cfg.flags.StaticRuntime,"MultiThreadedDebug", "MultiThreadedDebugDLL") else - runtime = iif(cfg.flags.Symbols, "MultiThreadedDebugDLL", "MultiThreadedDLL") + runtime = iif(cfg.flags.StaticRuntime, "MultiThreaded", "MultiThreadedDLL") end return runtime end @@ -321,6 +321,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers end end + local function debug_info(cfg) -- -- EditAndContinue /ZI @@ -645,9 +646,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers vs10_helpers.sort_input_files(cfg.files,sorted) io.eol = "\r\n" - --_p('<?xml version="1.0" encoding="utf-8"?>') _p(xml_version_and_encoding) - --_p('<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">') _p('<Project ' ..tool_version_and_xmlns ..'>') write_filter_includes(sorted) write_file_filter_block(sorted.ClInclude,"ClInclude") @@ -659,9 +658,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers function premake.vs2010_vcxproj(prj) io.eol = "\r\n" - --_p('<?xml version="1.0" encoding="utf-8"?>') _p(xml_version_and_encoding) - --_p('<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">') _p('<Project DefaultTargets="Build" ' ..tool_version_and_xmlns ..'>') vs2010_config(prj) vs2010_globals(prj) @@ -697,9 +694,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers function premake.vs2010_vcxproj_user(prj) - --_p('<?xml version="1.0" encoding="utf-8"?>') _p(xml_version_and_encoding) - --_p('<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">') _p('<Project ' ..tool_version_and_xmlns ..'>') _p('</Project>') end diff --git a/tests/actions/vstudio/test_vs2010_flags.lua b/tests/actions/vstudio/test_vs2010_flags.lua index 258ef25..cd228fc 100644 --- a/tests/actions/vstudio/test_vs2010_flags.lua +++ b/tests/actions/vstudio/test_vs2010_flags.lua @@ -142,41 +142,33 @@ function vs10_flags.optimizeSpeed_optimization_setToMaxSpeed() buffer = get_buffer() test.string_contains(buffer,'<Optimization>Full</Optimization>') end - -function vs10_flags.noStaticRuntime_runtimeLibrary_setToMultiThreadedDLL() - buffer = get_buffer() - test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>') -end - ---[[ -function vs10_flags.symbols_runtimeLibrary_setToMultiThreadedDebugDLL() - flags {"Symbols"} - - buffer = get_buffer() - test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>') -end ---]] - -function vs10_flags.noStaticRuntimeYetSymbols_runtimeLibrary_setToMultiThreadedDebugDLL() - flags {"Symbols"} - - buffer = get_buffer() - test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>') -end - -function vs10_flags.staticRuntime_runtimeLibrary_setToMultiThreaded() - flags {"StaticRuntime"} - - buffer = get_buffer() - test.string_contains(buffer,'<RuntimeLibrary>MultiThreaded</RuntimeLibrary>') -end - -function vs10_flags.staticRuntimeAndSymbols_runtimeLibrary_setToMultiThreadedDebug() - flags {"StaticRuntime","Symbols"} - - buffer = get_buffer() - test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>') -end +
+
+local debug_string = "Symbols"
+local release_string = "Optimize" +function vs10_flags.debugHasNoStaticRuntime_runtimeLibrary_setToMultiThreadedDebugDLL()
+ flags {debug_string}
+ local buffer = get_buffer()
+ test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>')
+end
+
+function vs10_flags.debugAndStaticRuntime_runtimeLibrary_setToMultiThreadedDebug()
+ flags {debug_string,"StaticRuntime"}
+ local buffer = get_buffer()
+ test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>')
+end
+
+function vs10_flags.releaseHasNoStaticRuntime_runtimeLibrary_setToMultiThreadedDLL()
+ flags {release_string}
+ local buffer = get_buffer()
+ test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>')
+end
+
+function vs10_flags.releaseAndStaticRuntime_runtimeLibrary_setToMultiThreaded()
+ flags {release_string,"StaticRuntime"}
+ local buffer = get_buffer()
+ test.string_contains(buffer,'<RuntimeLibrary>MultiThreaded</RuntimeLibrary>')
+end
function vs10_flags.noCharacterSetDefine_characterSet_setToMultiByte() buffer = get_buffer() |