如何循环添加可执行目标
#3929
Replies: 1 comment
-
for _, fi in get_files("examples/**.c") do
target(fi.basename)
add_files(fi.path)
set_rundir(fi.dir)
end |
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.
-
例如我的 src 目录下有
main1.cpp
、main2.cpp、main3.cpp
等 c++ 文件,我希望能有一种方法,通过循环的方式将这 3 个文件生成 3 个可执行的目标,如果后面加上一个main4.cpp
,也能自动生成,无需使用add_target
添加。Beta Was this translation helpful? Give feedback.
All reactions