如何对每个c文件单独设置宏定义值? #4563
Unanswered
Dozingfiretruck
asked this question in
Q&A
Replies: 3 comments 2 replies
-
add_files("test/*.c", "test2/test2.c", {defines = "TEST2", languages = "c99", includedirs = ".", cflags = "-O0"}) |
Beta Was this translation helpful? Give feedback.
1 reply
-
for _, file in ipairs(os.files(path.join(os.scriptdir(), "test/*.c"))) do
add_files(file, {defines = "XXX"})
end |
Beta Was this translation helpful? Give feedback.
0 replies
-
我们开放的是sdk,用户会直接add_files,而不是这么处理,文件和目录较多 |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
如何对每个c文件单独设置宏定义值?
使用before_build_file可以在每个源文件编译前处理,但是如何修改宏呢?没有接口我尝试使用
for _, dep_define_flasg in pairs(target:get("defines")) do
if dep_define_flasg:startswith("CURRENT_FILE_NAME=") then
print("dep_define_flasg",dep_define_flasg)
dep_define_flasg = "CURRENT_FILE_NAME=qqqqqqqqqqqq"
end
end
打印出来看还是之前的,qqqqqqqqqqqq并未生效
Beta Was this translation helpful? Give feedback.
All reactions