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

binary target如果没有源文件就不会编译deps的源码 #5042

Closed
Dozingfiretruck opened this issue May 2, 2024 · 3 comments
Closed
Labels

Comments

@Dozingfiretruck
Copy link

Dozingfiretruck commented May 2, 2024

Xmake 版本

2.9.1

操作系统版本和架构

win11

描述问题

我在尝试是否可以和一些ide很好的进行互转,比如keil,所以遇到了这种问题:
Keil 是整体的项目名作为编译目标名,其他的都是作为子分组,转化为xmake格式就变成了这样

target("A",function()
    set_kind("object")
    add_includedirs("xxx")
    add_files("xxx")
end)

target("B",function()
    set_kind("object")
    add_includedirs("xxx")
    add_files("xxx")
end)

target("target_name",function()
    set_kind("binary")
    set_extension(".axf")

    add_deps("A","B")

    after_build(
        function(target)
			-- 
        end
    )
end)


但是这样的话就存在了 binary 中没有源文件,源文件都在deps的object target中,编译异常

期待的结果

希望可以编译deps的target,能够正常编译连接

工程配置

target("A",function()
    set_kind("object")
    add_includedirs("xxx")
    add_files("xxx")
end)

target("B",function()
    set_kind("object")
    add_includedirs("xxx")
    add_files("xxx")
end)

target("target_name",function()
    set_kind("binary")
    set_extension(".axf")

    add_deps("A","B")

    after_build(
        function(target)
			-- 
        end
    )
end)


附加信息和错误日志

无报错

@Issues-translate-bot
Copy link

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


Title: binary target will not compile the deps source code if there is no source file.

@Dozingfiretruck
Copy link
Author

对比错了目录,验证可用,理论上可以直接转换,xmake编译比keil真的是快的多,keil多线程编译有问题

@Issues-translate-bot
Copy link

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


The wrong directory is compared, and the verification is available. In theory, it can be converted directly. The xmake compilation is really much faster than the keil. There is a problem with the keil multi-thread compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants