How do I get the value of system ()?
1 answer
Premake doesn't work this way, there is no "current" version of the data. You must specify the context in which you want to apply the current set of filters; take a look at src / base / oven.lua to see how the final datasets are built.
If you just want to cast the system (or architecture or platform) value into an expression later in the process (and you are using Premake 5), check out tokens :
targetdir "bin/%{cfg.system}/%{cfg.architecture}"
Tokens can also evaluate arbitrary Lua expressions.
my_system_map = { -- must be global, so token evaluator can find it
windows = "Win32",
linux = "Posix",
macosx = "Mac"
}
targetdir "bin/%{my_system_map[cfg.system]}"
Helpful?
+1
source to share