summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/msvc
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2024-02-04 20:24:24 +0100
committerArthur LAURENT <[email protected]>2024-02-05 13:58:27 +0100
commit2328ca4f94c6a7680c72fc92f43a39c4f753d7a3 (patch)
treeaa3584bc921b737b5e00830754075a46e67156b1 /xmake/rules/c++/modules/modules_support/msvc
parent4a6acafb07f5af250c51604c731dba7fafdd8547 (diff)
fix missing objectfiles for private modules
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/msvc')
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc/builder.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/modules_support/msvc/builder.lua b/xmake/rules/c++/modules/modules_support/msvc/builder.lua
index e7b2c8543..702f3f2f2 100644
--- a/xmake/rules/c++/modules/modules_support/msvc/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc/builder.lua
@@ -259,7 +259,10 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, opt)
end
end
- local build_objectfile = target:kind() == "binary"
+ local fileconfig = target:fileconfig(opt.cppfile)
+ local public = fileconfig and fileconfig.public
+ local external = fileconfig and fileconfig.external
+ local build_objectfile = target:kind() == "binary" or (not public and not external)
local flags = _make_modulebuildflags(target, provide, bmifile, {build_objectfile = build_objectfile})
_compile(target, flags, opt.cppfile, opt.objectfile)
@@ -306,7 +309,10 @@ function make_module_buildcmds(target, batchcmds, should_build, mark_build, opt)
batchcmds:show_progress(opt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
batchcmds:mkdir(path.directory(opt.objectfile))
- local build_objectfile = target:kind() == "binary"
+ local fileconfig = target:fileconfig(opt.cppfile)
+ local public = fileconfig and fileconfig.public
+ local external = fileconfig and fileconfig.external
+ local build_objectfile = target:kind() == "binary" or (not public and not external)
local flags = _make_modulebuildflags(target, provide, bmifile, opt.cppfile, {batchcmds = true, build_objectfile = build_objectfile})
_batchcmds_compile(batchcmds, target, flags, opt.cppfile, opt.objectfile)
else