请求添加类似 cargo bin 功能 #3094
ShuttleSpace
started this conversation in
Ideas
Replies: 1 comment
-
自己配,也就两三行代码的事情,没必要什么都让 xmake 支持。。 for _, file in ipairs(os.files("bin/*.cpp")) do
target(path.basename(file))
set_kind("binary")
add_files(file)
end $ xmake
[ 25%]: cache compiling.release bin/foo.cpp
[ 25%]: cache compiling.release bin/bar.cpp
[ 50%]: linking.release foo
[ 50%]: linking.release bar
[100%]: build ok! $ xmake run foo |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
你在什么场景下需要该功能?
cargo 如果配置的 binary 项目,会按文件名自动编译 src/bin 目录下的文件,生成对应的二进制可执行文件。
xmake 是否可以也支持这样的功能❤️, 方便完成一些 demo、功能验证、测试类的需求。
描述可能的解决方案
1、xmake 可以自动检测项目目录下的 bin 或者 src/bin 目录。
2、xmake build 会编译所有的 bin 或 src/bin 目录下的文件为对应的二进制可执行文件
3、xmake r bin1 执行对应的二进制可执行文件
描述你认为的候选方案
No response
其他信息
No response
Beta Was this translation helpful? Give feedback.
All reactions