option和target下的add_defines行为不同, 这是设计如此还是bug? #6367
Unanswered
ZZH-Finalize
asked this question in
Q&A
Replies: 3 comments
-
option的值变化后能生效的写法:
option的值变化后无法生效的写法:
这是正常现象还是bug? |
Beta Was this translation helpful? Give feedback.
0 replies
-
可以试试在 option 用脚本域,on_config,直接用 target:add("defines", "xxxx") |
Beta Was this translation helpful? Give feedback.
0 replies
-
也可以先做好 option_end(),然后再写 if is_config("CFG", "xxx") then add_defines("xxx") 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.
-
我本意是想通过xmake f --menu的界面来调整C代码里宏定义的值, 正常来说如果修改了这个值, 那么就应该生成新的宏定义并且C文件应当重新编译, 但我发现, 如果把生成宏定义的add_defines语句放在target的定义下面, 这些动作都是正常的, 但如果把它放在option下面, 然后target下面添加对应的option, 那么当option的值改变时, 就不会生成新的宏定义,代码也不会重新编译
Beta Was this translation helpful? Give feedback.
All reactions