From 858838adf60ea17ce51a82bfe668463a4e92cf6f Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 19 Mar 2026 22:41:51 +0800 Subject: improve ldc on windows --- xmake/modules/core/tools/ldc2.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xmake/modules/core/tools/ldc2.lua b/xmake/modules/core/tools/ldc2.lua index fa2e210a0..93215f940 100644 --- a/xmake/modules/core/tools/ldc2.lua +++ b/xmake/modules/core/tools/ldc2.lua @@ -48,6 +48,16 @@ function nf_optimize(self, level) return maps[level] end +-- make the linkdir flag +-- ldc2 on windows uses msvc link.exe which requires /libpath: (not -libpath:) +function nf_linkdir(self, dir) + if self:is_plat("windows") then + return {"-L/libpath:" .. dir} + else + return {"-L-L" .. dir} + end +end + -- make the symbol flag function nf_symbol(self, level) local kind = self:kind() -- cgit v1.3.1