diff options
| author | ruki <[email protected]> | 2025-08-19 13:56:59 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-19 13:56:59 +0800 |
| commit | 7c32176972ae2e4b83f54b677cb401722ef07113 (patch) | |
| tree | f704d1b2b31492a7c9a0dee5b6289b3c50bed2fa | |
| parent | c31cd67e1815e37620a1b8b252240d5dbbc1ed85 (diff) | |
| parent | a115f760c346a010a6633e230dcb57b4ce0f2df0 (diff) | |
Merge pull request #6719 from xmake-io/comax
improve comax for config
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/project/project.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/private/action/build/target.lua | 7 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/xmake.lua | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua index 2fdce5948..af1ae11bd 100644 --- a/xmake/core/sandbox/modules/import/core/project/project.lua +++ b/xmake/core/sandbox/modules/import/core/project/project.lua @@ -142,7 +142,7 @@ function sandbox_core_project._config_targets(opt) -- we need to config all targets (contains non-default targets) local targets_root = target_buildutils.get_root_targets(nil, {all = true}) - target_buildutils.run_targetjobs(targets_root, {job_kind = "config", job_opt = opt}) + target_buildutils.run_targetjobs(targets_root, {job_kind = "config", dep_fence = true, job_opt = opt}) end -- load rules in the required packages for target diff --git a/xmake/modules/private/action/build/target.lua b/xmake/modules/private/action/build/target.lua index 0116dcd6f..444dfc18e 100644 --- a/xmake/modules/private/action/build/target.lua +++ b/xmake/modules/private/action/build/target.lua @@ -115,7 +115,8 @@ end function _add_targetjobs_deep_orders(jobgraph, target, dep, opt) local jobname, jobname_dep local job_kind = opt.job_kind - if dep:policy("build.fence") or dep:policy("build.across_targets_in_parallel") == false then + local dep_fence = opt.dep_fence or dep:policy("build.fence") or dep:policy("build.across_targets_in_parallel") == false + if dep_fence then jobname = string.format("%s/begin_%s", target:fullname(), job_kind) jobname_dep = string.format("%s/end_%s", dep:fullname(), job_kind) -- build.across_targets_in_parallel is deprecated @@ -786,7 +787,7 @@ function run_targetjobs(targets_root, opt) if errors and progress.showing_without_scroll() then print("") end - end, comax = option.get("jobs") or 1, curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor}) + end, comax = option.get("jobs") or os.default_njob(), curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor}) os.cd(curdir) return true end @@ -804,7 +805,7 @@ function run_filejobs(targets_root, opt) if errors and progress.showing_without_scroll() then print("") end - end, comax = option.get("jobs") or 1, curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor}) + end, comax = option.get("jobs") or os.default_njob(), curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor}) os.cd(curdir) return true end diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index ff4bcfc5a..c81e1500e 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -23,6 +23,11 @@ rule("c++.build.modules") -- @note support.contains_modules() need it set_extensions(".cppm", ".ccm", ".cxxm", ".c++m", ".mpp", ".mxx", ".ixx") + -- clang/support/config will be depend on target/symbols in release modules (hidden) + -- @see The default config parallel execution will cause incremental compilation problems + add_orders("mode.release", "c++.build.modules") + add_orders("mode.minsizerel", "c++.build.modules") + add_deps("c++.build.modules.scanner", "c++.build.modules.builder", "c++.build.modules.install") |
