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
The fragment feature to generate multiple build target combination at the same times works really well.
I have a local improvement in my generations files (without modifying Sharpmake) that I think could be beneficial to be supported natively. It is the ability to filter out certain fragments combination, before adding the target.
Example:
I request the support of...
DevEnv: VS2022, Makefile
Platform: Win64, Linux
But I do not want Linux to generate a VS2022 solution...
Now, I could just create 2 differents Targets to accommodate this, but in more complex case, it ends up having to specify individually each supported Target combination.
My suggestion is to have a virtual method that Sharpmake queries just before internally adding each target combination (or could use the tagging method similar to [configure]). Here's an example of what it could look like:
public class CustomTarget : Target
{
public override bool IsValidTarget()
{
if( (Platform& Platform.Linux) != 0 && DevEnv.IsVisualStudio() ){
return false;
}
return base.IsValidTarget();
}
}
public class SomeBase : Project
{
public ProjectBase()
: base(typeof(CustomTarget))
{
Name = "SomeProject";
outTargets.Add(new CustomTarget(
DevEnv.vs2022 | DevEnv.make,
Platform.win64|Platform.linux,
Optimization.Debug | Optimization.Release | Optimization.Retail));
}
}
This would allow user to easily defines their own conditions and also handle their custom fragments.
The text was updated successfully, but these errors were encountered:
sammyfreg
changed the title
Per fragment combination target generation
Target fragment combination filtering
Sep 4, 2022
The fragment feature to generate multiple build target combination at the same times works really well.
I have a local improvement in my generations files (without modifying Sharpmake) that I think could be beneficial to be supported natively. It is the ability to filter out certain fragments combination, before adding the target.
Example:
I request the support of...
VS2022
,Makefile
Win64
,Linux
But I do not want
Linux
to generate aVS2022
solution...Now, I could just create 2 differents Targets to accommodate this, but in more complex case, it ends up having to specify individually each supported Target combination.
My suggestion is to have a virtual method that Sharpmake queries just before internally adding each target combination (or could use the tagging method similar to [configure]). Here's an example of what it could look like:
This would allow user to easily defines their own conditions and also handle their custom fragments.
The text was updated successfully, but these errors were encountered: