Options are visible only in the config phase #2975
Unanswered
davidchisnall
asked this question in
Q&A
Replies: 1 comment
-
please use if has_config("test") then
add_defines("TEST")
end target("target")
add_files("foo.c")
add_options("test")
on_load(function (target)
local value = get_config("test")
end) target("target")
add_files("foo.c")
add_options("test")
on_load(function (target)
import("core.project.config")
local value = config.get("test")
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 Version
v2.7.2+dev.d9595826e
Operating System Version and Architecture
FreeBSD
Describe Bug
Options can be set during the configure phase, but they are not then visible during the build. Simple test case:
During configuration:
Then when you build:
It's not clear how configuration options should be persisted. I cannot specify the option at build time:
Other options that I have used persist for a few builds but get lost at some later point.
Expected Behavior
Project Configuration
No response
Additional Information and Error Logs
No response
Beta Was this translation helpful? Give feedback.
All reactions