From 6a01e51df07697cfca2bdf3a4126a68b077acdec Mon Sep 17 00:00:00 2001 From: nickclark2016 Date: Mon, 21 Sep 2020 18:01:55 -0400 Subject: [PATCH] Fixed external library link names for clang in VS2019+ --- modules/vstudio/tests/vc2019/test_link.lua | 43 ++++++++++++++++++++++ modules/vstudio/vs2010_vcxproj.lua | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 modules/vstudio/tests/vc2019/test_link.lua diff --git a/modules/vstudio/tests/vc2019/test_link.lua b/modules/vstudio/tests/vc2019/test_link.lua new file mode 100644 index 00000000..3a6ad4be --- /dev/null +++ b/modules/vstudio/tests/vc2019/test_link.lua @@ -0,0 +1,43 @@ +-- +-- 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.configurationProperties(cfg) + end + +-- +-- Check link command for a static library using a clang toolset +-- + + function suite.toolsetClangAdditionalDependencies() + function suite.additionalDependencies_onSystemLinks() + links { "lua", "zlib" } + toolset "clang" + prepare() + test.capture [[ + + Windows + lua.lib;zlib.lib;%(AdditionalDependencies) + ]] + end + end \ No newline at end of file diff --git a/modules/vstudio/vs2010_vcxproj.lua b/modules/vstudio/vs2010_vcxproj.lua index 8d25b904..b04fec98 100644 --- a/modules/vstudio/vs2010_vcxproj.lua +++ b/modules/vstudio/vs2010_vcxproj.lua @@ -1397,7 +1397,7 @@ -- check to see if this project uses an external toolset. If so, let the -- toolset define the format of the links local toolset = config.toolset(cfg) - if toolset then + if cfg.system ~= premake.WINDOWS and toolset then links = toolset.getlinks(cfg, not explicit) else links = vstudio.getLinks(cfg, explicit)