summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2024-01-29 12:18:01 +0100
committerArthur LAURENT <[email protected]>2024-01-29 12:29:21 +0100
commitd50a83fbfcd59db2a8a5fc0f8fe14770f9a0d16b (patch)
treef50ec6b8703586050df3fe37eb588cc9187ba5c4 /xmake/rules/c++/modules
parentcb8b45ba6e641156ca2e7544cce901c749b9d30a (diff)
apply PR suggestions
Diffstat (limited to 'xmake/rules/c++/modules')
-rw-r--r--xmake/rules/c++/modules/modules_support/builder.lua13
-rw-r--r--xmake/rules/c++/modules/modules_support/clang/compiler_support.lua6
2 files changed, 14 insertions, 5 deletions
diff --git a/xmake/rules/c++/modules/modules_support/builder.lua b/xmake/rules/c++/modules/modules_support/builder.lua
index 481415661..4592e547d 100644
--- a/xmake/rules/c++/modules/modules_support/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/builder.lua
@@ -33,6 +33,8 @@ import("dependency_scanner")
function _build_modules(target, sourcebatch, modules, opt)
local objectfiles = dependency_scanner.sort_modules_by_dependencies(sourcebatch.objectfiles, modules)
+ compiler_support.memcache():set2(target:name(), "need_to_repopulate", false)
+
-- build modules
for _, objectfile in ipairs(objectfiles) do
local module = modules[objectfile]
@@ -62,6 +64,9 @@ function _build_modules(target, sourcebatch, modules, opt)
table.insert(deps, opt.batchjobs and target:name() .. dep or dep)
end
+ if build then
+ compiler_support.memcache():set2(target:name(), "need_to_repopulate", true)
+ end
opt.build_module(deps, build, module, name, provide, objectfile, cppfile, fileconfig)
::CONTINUE::
@@ -183,11 +188,15 @@ function _init_build_for(target, batch, modules, opt)
return { modulemap_populatejob_name = {
name = job_name,
job = batch:addjob(job_name, function(index, total)
- progress.show((index * 100) / total, "${color.build.target}<%s> populating.%s.map", target:name(), opt.type)
+ if compiler_support.memcache():get2(target:name(), "need_to_repopulate") then
+ progress.show((index * 100) / total, "${color.build.target}<%s> populating.%s.map", target:name(), opt.type)
+ end
_builder(target).populate_module_map(target, modules)
end)}}
else
- batch:show_progress(opt.progress, "${color.build.target}<%s> populating.%s.map", target:name(), opt.type)
+ if compiler_support.memcache():get2(target:name(), "need_to_repopulate") then
+ batch:show_progress(opt.progress, "${color.build.target}<%s> populating.%s.map", target:name(), opt.type)
+ end
_builder(target).populate_module_map(target, modules)
end
end
diff --git a/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua b/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua
index 95578acee..6e4b36645 100644
--- a/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua
+++ b/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua
@@ -60,11 +60,11 @@ function get_cpplibrary_name(target)
local runtime = target:runtimes()
if not runtime then
- if is_plat("windows") then
+ if target:is_plat("windows") then
runtime = "msstl"
- elseif is_plat("linux") or is_plat("android") then
+ elseif target:is_plat("linux") or target:is_plat("android") then
runtime = "stdc++_shared"
- elseif is_plat("macosx") or is_plat("iphoneos") or is_plat("watchos") then
+ elseif target:is_plat("macosx") or target:is_plat("iphoneos") or target:is_plat("watchos") then
runtime = "c++_shared"
end
end