You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Normally, add_files will ignore all files that do not currently exist, which is no problem.
However, when we need to dynamically generate source code to compile them, because the current file does not yet exist, the compilation of them will be lost.
We can only compile them by actively invoking the compiler in the rule and adding object files to target.
Although this is very flexible, it is not very friendly to some users who are just getting started.
Therefore, we improved the support for add_files and added the {always_added = true} configuration to tell xmake that we always need to add the specified source file, even if it does not exist yet.
In this way, we can rely on xmake's default compilation process to compile the automatically generated code.
However, we also need to pay attention to that, since the currently automatically generated source file may not yet exist, we cannot use pattern matching in add_files("src/*.cpp", {always_added = true}), we only can add each source file path explicitly.
Normally, add_files will ignore all files that do not currently exist, which is no problem.
However, when we need to dynamically generate source code to compile them, because the current file does not yet exist, the compilation of them will be lost.
We can only compile them by actively invoking the compiler in the rule and adding object files to target.
like this
Although this is very flexible, it is not very friendly to some users who are just getting started.
Therefore, we improved the support for add_files and added the
{always_added = true}
configuration to tell xmake that we always need to add the specified source file, even if it does not exist yet.In this way, we can rely on xmake's default compilation process to compile the automatically generated code.
like this
However, we also need to pay attention to that, since the currently automatically generated source file may not yet exist, we cannot use pattern matching in
add_files("src/*.cpp", {always_added = true})
, we only can add each source file path explicitly.Related issues:
#1090
#1246
The text was updated successfully, but these errors were encountered: