Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ccache when debug package #5874

Open
1 of 2 tasks
star-hengxing opened this issue Nov 23, 2024 · 2 comments
Open
1 of 2 tasks

Support ccache when debug package #5874

star-hengxing opened this issue Nov 23, 2024 · 2 comments

Comments

@star-hengxing
Copy link
Contributor

star-hengxing commented Nov 23, 2024

Is your feature request related to a problem? Please describe.

  • Where to set ccache dir.
  • Enable by default or policy.

Describe the solution you'd like

if true then
    local ccache
    ccache = find_tool("ccache")
    if not ccache then
        ccache = find_tool("sccache")
    end

    if ccache then
        local name = path.basename(ccache.program)
        package:data_set("ccache", name)
        local ccache_dir = path.join(path.directory(path.directory(os.curdir())), name)
        os.setenv(name:upper() .. "_DIR", ccache_dir)
        print("ccache enabled, cache dir:", ccache_dir)
    end
end

local ccache = package:data("ccache")
if ccache then
    table.insert(configs, "-DCMAKE_C_COMPILER_LAUNCHER=" .. ccache)
    table.insert(configs, "-DCMAKE_CXX_COMPILER_LAUNCHER=" .. ccache)
end
@waruqi
Copy link
Member

waruqi commented Nov 23, 2024

可以提个 pr 过来,通过 policy 配置,不过不建议默认开,还是用户按需开比较好,比如大部分情况下,用户都不会去调试包。仅仅一次编译。

@Issues-translate-bot
Copy link

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


You can submit a PR and configure it through policy, but it is not recommended to enable it by default. It is better for users to enable it on demand. For example, in most cases, users will not debug packages. Just compile once.

@waruqi waruqi added this to the v2.9.7 milestone Dec 3, 2024
@waruqi waruqi removed this from the v2.9.7 milestone Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants