From 69719027311578eeea537d0603f071887008176c Mon Sep 17 00:00:00 2001 From: Tom van Dijck Date: Thu, 3 Sep 2015 11:54:53 -0700 Subject: [PATCH] Adding /Debug:FastLink support for VS2015. --- src/_premake_init.lua | 1 + src/actions/vstudio/vs2010_vcxproj.lua | 20 ++++++++++++- .../vstudio/vc2010/test_compile_settings.lua | 16 ++++++++++ .../vstudio/vc2010/test_excluded_configs.lua | 2 -- tests/actions/vstudio/vc2010/test_link.lua | 29 ------------------- .../actions/vstudio/vc2010/test_rule_vars.lua | 4 +-- 6 files changed, 38 insertions(+), 34 deletions(-) diff --git a/src/_premake_init.lua b/src/_premake_init.lua index 13f75d11..4e3ddf18 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -953,6 +953,7 @@ "Default", "On", "Off", + "FastLink", -- Visual Studio 2015+ only, considered 'On' for all other cases. }, } diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index d93b8517..381d0f7a 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -1305,7 +1305,25 @@ function m.generateDebugInformation(cfg) - m.element("GenerateDebugInformation", nil, tostring(cfg.symbols == p.ON)) + local lookup = {} + if _ACTION >= "vs2015" then + lookup[p.ON] = "Debug" + lookup[p.OFF] = "No" + lookup["FastLink"] = "DebugFastLink" + + if cfg.symbols == "FastLink" then + m.element("FullProgramDatabaseFile", nil, "true") + end + else + lookup[p.ON] = "true" + lookup[p.OFF] = "false" + lookup["FastLink"] = "true" + end + + local value = lookup[cfg.symbols] + if value then + m.element("GenerateDebugInformation", nil, value) + end end diff --git a/tests/actions/vstudio/vc2010/test_compile_settings.lua b/tests/actions/vstudio/vc2010/test_compile_settings.lua index 997b367f..c6f1b568 100644 --- a/tests/actions/vstudio/vc2010/test_compile_settings.lua +++ b/tests/actions/vstudio/vc2010/test_compile_settings.lua @@ -753,3 +753,19 @@ true ]] end + + +-- +-- Check handling of the explicitly disabling symbols. +-- + function suite.onNoSymbols() + symbols 'Off' + prepare() + test.capture [[ + + NotUsing + Level3 + None + Disabled + ]] + end diff --git a/tests/actions/vstudio/vc2010/test_excluded_configs.lua b/tests/actions/vstudio/vc2010/test_excluded_configs.lua index 3f2b54cc..cdb28d21 100644 --- a/tests/actions/vstudio/vc2010/test_excluded_configs.lua +++ b/tests/actions/vstudio/vc2010/test_excluded_configs.lua @@ -51,7 +51,6 @@ test.capture [[ Console - false mainCRTStartup ]] @@ -70,7 +69,6 @@ test.capture [[ Console - false bin\Ares\Debug\MyProject2.lib;%(AdditionalDependencies) mainCRTStartup diff --git a/tests/actions/vstudio/vc2010/test_link.lua b/tests/actions/vstudio/vc2010/test_link.lua index 98f44021..2da8d427 100644 --- a/tests/actions/vstudio/vc2010/test_link.lua +++ b/tests/actions/vstudio/vc2010/test_link.lua @@ -37,7 +37,6 @@ test.capture [[ Windows - false bin\Debug\MyProject.lib ]] @@ -54,7 +53,6 @@ test.capture [[ Windows - false true true bin\Debug\MyProject.lib @@ -73,7 +71,6 @@ test.capture [[ Console - false mainCRTStartup ]] end @@ -84,7 +81,6 @@ test.capture [[ Windows - false mainCRTStartup ]] end @@ -95,7 +91,6 @@ test.capture [[ Windows - false bin\Debug\MyProject.lib ]] @@ -107,7 +102,6 @@ test.capture [[ Windows - false ]] end @@ -123,7 +117,6 @@ test.capture [[ Windows - false bin\Debug\MyProject.lib @@ -158,7 +151,6 @@ test.capture [[ Windows - false lua.lib;zlib.lib;%(AdditionalDependencies) ]] end @@ -175,7 +167,6 @@ test.capture [[ Windows - false lua.obj;zlib.lib;%(AdditionalDependencies) ]] end @@ -192,7 +183,6 @@ test.capture [[ Windows - false lua.5.3.lib;lua.5.4.lib;%(AdditionalDependencies) ]] end @@ -208,7 +198,6 @@ test.capture [[ Windows - false ..\lib;..\lib64;%(AdditionalLibraryDirectories) ]] end @@ -227,7 +216,6 @@ test.capture [[ Windows - false bin\Debug\MyProject.lib ]] @@ -247,7 +235,6 @@ test.capture [[ Windows - false bin\Debug\MyProject2.lib;%(AdditionalDependencies) bin\Debug\MyProject.lib @@ -271,7 +258,6 @@ test.capture [[ Windows - false ]] end @@ -287,7 +273,6 @@ test.capture [[ Windows - false ..\lib\MyProject.lib ]] @@ -306,7 +291,6 @@ test.capture [[ Windows - false bin\Debug\MyProject.lib /kupo %(AdditionalOptions) ]] @@ -319,7 +303,6 @@ test.capture [[ Windows - false /kupo %(AdditionalOptions) @@ -338,7 +321,6 @@ test.capture [[ Windows - false true true ]] @@ -355,7 +337,6 @@ test.capture [[ Windows - false bin\Debug\MyProject.lib hello.def @@ -373,7 +354,6 @@ test.capture [[ Windows - false kernel32.lib;%(AdditionalDependencies) ]] end @@ -388,9 +368,6 @@ system "Xbox360" prepare() test.capture [[ - - false - ]] end @@ -404,7 +381,6 @@ prepare() test.capture [[ - false user32.lib;%(AdditionalDependencies) ]] @@ -422,7 +398,6 @@ test.capture [[ Console - false mainCRTStartup true ]] @@ -435,7 +410,6 @@ test.capture [[ Windows - false true @@ -454,7 +428,6 @@ test.capture [[ Windows - false bin\Debug\MyProject.lib true @@ -471,7 +444,6 @@ test.capture [[ Windows - false bin\Debug\MyProject.lib lib1.lib;lib2.obj @@ -488,7 +460,6 @@ test.capture [[ Windows - false bin\Debug\MyProject.lib lib1.lib;lib2.obj diff --git a/tests/actions/vstudio/vc2010/test_rule_vars.lua b/tests/actions/vstudio/vc2010/test_rule_vars.lua index ce66dbf2..6314a75c 100644 --- a/tests/actions/vstudio/vc2010/test_rule_vars.lua +++ b/tests/actions/vstudio/vc2010/test_rule_vars.lua @@ -100,11 +100,11 @@ function suite.onPathVar() createVar { name="MyVar", kind="path" } - myRuleVars { MyVar = "../../path/to/file" } + myRuleVars { MyVar = "../path/to/file" } prepare() test.capture [[ - ..\..\path\to\file + ..\path\to\file ]] end