From e89e0eb8e7b1f755d2c945b0ca07c9fed2058d97 Mon Sep 17 00:00:00 2001 From: liamDevine Date: Sun, 31 Oct 2010 23:18:15 +0000 Subject: [PATCH] Fixes vs10 Bug 3100062 uses premake.config.isdebugbuild to determine debug status --- CHANGES.txt | 2 +- src/actions/vstudio/vs2010_vcxproxj.lua | 13 ++--- tests/actions/vstudio/test_vs2010_flags.lua | 62 +++++++++------------ 3 files changed, 32 insertions(+), 45 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index e6e03d17..9ad543af 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 63ce3971..fe65465f 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('') _p(xml_version_and_encoding) - --_p('') _p('') 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('') _p(xml_version_and_encoding) - --_p('') _p('') vs2010_config(prj) vs2010_globals(prj) @@ -697,9 +694,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers function premake.vs2010_vcxproj_user(prj) - --_p('') _p(xml_version_and_encoding) - --_p('') _p('') _p('') end diff --git a/tests/actions/vstudio/test_vs2010_flags.lua b/tests/actions/vstudio/test_vs2010_flags.lua index 258ef25f..cd228fcd 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,'Full') end - -function vs10_flags.noStaticRuntime_runtimeLibrary_setToMultiThreadedDLL() - buffer = get_buffer() - test.string_contains(buffer,'MultiThreadedDLL') -end - ---[[ -function vs10_flags.symbols_runtimeLibrary_setToMultiThreadedDebugDLL() - flags {"Symbols"} - - buffer = get_buffer() - test.string_contains(buffer,'MultiThreadedDebugDLL') -end ---]] - -function vs10_flags.noStaticRuntimeYetSymbols_runtimeLibrary_setToMultiThreadedDebugDLL() - flags {"Symbols"} - - buffer = get_buffer() - test.string_contains(buffer,'MultiThreadedDebugDLL') -end - -function vs10_flags.staticRuntime_runtimeLibrary_setToMultiThreaded() - flags {"StaticRuntime"} - - buffer = get_buffer() - test.string_contains(buffer,'MultiThreaded') -end - -function vs10_flags.staticRuntimeAndSymbols_runtimeLibrary_setToMultiThreadedDebug() - flags {"StaticRuntime","Symbols"} - - buffer = get_buffer() - test.string_contains(buffer,'MultiThreadedDebug') -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,'MultiThreadedDebugDLL') +end + +function vs10_flags.debugAndStaticRuntime_runtimeLibrary_setToMultiThreadedDebug() + flags {debug_string,"StaticRuntime"} + local buffer = get_buffer() + test.string_contains(buffer,'MultiThreadedDebug') +end + +function vs10_flags.releaseHasNoStaticRuntime_runtimeLibrary_setToMultiThreadedDLL() + flags {release_string} + local buffer = get_buffer() + test.string_contains(buffer,'MultiThreadedDLL') +end + +function vs10_flags.releaseAndStaticRuntime_runtimeLibrary_setToMultiThreaded() + flags {release_string,"StaticRuntime"} + local buffer = get_buffer() + test.string_contains(buffer,'MultiThreaded') +end function vs10_flags.noCharacterSetDefine_characterSet_setToMultiByte() buffer = get_buffer()