Skip to content

Commit 0513166

Browse files
committed
fix publish csharp
1 parent 27bd61c commit 0513166

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

xmake/rules/csharp/install.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ function _get_configuration()
3535
return "Release"
3636
end
3737

38-
-- get output directory for dotnet publish
38+
-- get output directory based on target kind
39+
-- on windows, shared libraries (dll) should also go to bindir
3940
function _get_outputdir(target)
40-
if target:is_binary() then
41+
if target:is_binary() or (target:is_shared() and target:is_plat("windows", "mingw")) then
4142
return target:bindir()
4243
else
4344
return target:libdir()
@@ -63,7 +64,7 @@ function main(target)
6364
if csprojfile then
6465
table.insert(argv, csprojfile)
6566
end
66-
table.join2(argv, {"--nologo", "--no-build",
67+
table.join2(argv, {"--nologo",
6768
"--configuration", _get_configuration(),
6869
"--output", outputdir})
6970
local dotnet = _get_dotnet(target)

xmake/rules/csharp/installcmd.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ function main(target, batchcmds, opt)
4848
end
4949

5050
-- get output directory based on target kind
51+
-- on windows, shared libraries (dll) should also go to bindir
5152
local outputdir
52-
if target:is_binary() then
53+
if target:is_binary() or (target:is_shared() and target:is_plat("windows", "mingw")) then
5354
outputdir = package:installdir("bin")
5455
else
5556
outputdir = package:installdir("lib")
@@ -62,7 +63,7 @@ function main(target, batchcmds, opt)
6263
if csprojfile then
6364
table.insert(argv, csprojfile)
6465
end
65-
table.join2(argv, {"--nologo", "--no-build",
66+
table.join2(argv, {"--nologo",
6667
"--configuration", _get_configuration(),
6768
"--output", publishdir})
6869
local dotnet = _get_dotnet(target)

0 commit comments

Comments
 (0)