Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

option和target下的add_defines行为不同, 这是设计如此还是bug? #6367

Unanswered
ZZH-Finalize asked this question in Q&A
Discussion options

我本意是想通过xmake f --menu的界面来调整C代码里宏定义的值, 正常来说如果修改了这个值, 那么就应该生成新的宏定义并且C文件应当重新编译, 但我发现, 如果把生成宏定义的add_defines语句放在target的定义下面, 这些动作都是正常的, 但如果把它放在option下面, 然后target下面添加对应的option, 那么当option的值改变时, 就不会生成新的宏定义,代码也不会重新编译

You must be logged in to vote

Replies: 1 comment

Comment options

option的值变化后能生效的写法:

option('CFG')
    set_default('4')

target('main')
    add_defines('CONFIG_A=$(CFG)')

option的值变化后无法生效的写法:

option('CFG')
    set_default('4')
    add_defines('CONFIG_A=$(CFG)')

target('main')
    add_options('CFG')

这是正常现象还是bug?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.