Skip to content

improve to config targets#6667

Merged
waruqi merged 5 commits intodevfrom
config
Aug 5, 2025
Merged

improve to config targets#6667
waruqi merged 5 commits intodevfrom
config

Conversation

@waruqi
Copy link
Member

@waruqi waruqi commented Jul 31, 2025

@waruqi waruqi added this to the v3.0.2 milestone Jul 31, 2025
@waruqi waruqi merged commit c6383c7 into dev Aug 5, 2025
44 checks passed
@star-hengxing
Copy link
Contributor

Break 了这些代码:
https://github.com/clice-project/clice/blob/7aec7feb6e6744a16c0d26e61143350892ccefd8/xmake.lua#L117-L122

on_config 里设置 runargs 没生效

@waruqi waruqi deleted the config branch August 6, 2025 02:20
@waruqi waruqi restored the config branch August 6, 2025 02:23
waruqi added a commit that referenced this pull request Aug 6, 2025
improve to config targets
@waruqi
Copy link
Member Author

waruqi commented Aug 6, 2025

暂时没空看,先 revert 了。。等回头有空嘞再说 #6676

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Break these codes:
https://github.com/clice-project/clice/blob/7aec7feb6e6744a16c0d26e61143350892ccefd8/xmake.lua#L117-L122

Setting runargs in on_config does not take effect

@waruqi
Copy link
Member Author

waruqi commented Aug 6, 2025

我看可以的么,按理应该不会影响到这个,仅仅只是改了并行顺序,只要 on_config 执行没有遗漏,就应该会生效

给个可复现的最小例子。

add_rules("mode.debug", "mode.release")

target("test")
    set_kind("binary")
    add_files("src/*.cpp")
    on_config(function (target)
        target:set("runargs", "--xxx=y")
    end)

run/main.lua

    local args = table.wrap(option.get("arguments") or target:get("runargs"))
    print("args", args)

    if not is_host("windows") and target:is_plat("windows") then
        local wine = assert(find_tool("wine"), "wine not found!")
        table.insert(args, 1, targetfile)
        targetfile = wine.program
    end

    -- debugging?
    if option.get("debug") then
        debugger.run(targetfile, args, {curdir = rundir, addenvs = addenvs, setenvs = setenvs})
    else
        os.execv(targetfile, args, {curdir = rundir, detach = option.get("detach"), addenvs = addenvs, setenvs = setenvs})
    end
ruki:test ruki$ xmake r
args {
  "--xxx=y"
}

@waruqi
Copy link
Member Author

waruqi commented Aug 6, 2025

Break 了这些代码: https://github.com/clice-project/clice/blob/7aec7feb6e6744a16c0d26e61143350892ccefd8/xmake.lua#L117-L122

on_config 里设置 runargs 没生效

再试试,应该可以了

@star-hengxing
Copy link
Contributor

先换成 after_load 了。


这里是一个设置 set_default(false) 的 test target,ci 在测试时没添加参数失败了,按道理也不复杂。
https://github.com/clice-project/clice/actions/runs/16756587723/job/47440751076

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Break these codes: https://github.com/clice-project/clice/blob/7aec7feb6e6744a16c0d26e61143350892ccefd8/xmake.lua#L117-L122

Setting runargs in on_config does not take effect

Try again, it should be OK

@waruqi
Copy link
Member Author

waruqi commented Aug 6, 2025

先换成 after_load 了。

这里是一个设置 set_default(false) 的 test target,ci 在测试时没添加参数失败了,按道理也不复杂。 https://github.com/clice-project/clice/actions/runs/16756587723/job/47440751076

再试试,应该可以了

刚我已经修了,试下最新 patch 就行了

@star-hengxing
Copy link
Contributor

没问题了。

waruqi added a commit that referenced this pull request Aug 6, 2025
Merge pull request #6667 from xmake-io/config
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


No problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants