Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to force project references export #220

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sharpmake.Generators/VisualStudio/Vcxproj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ private void GenerateProjectReferences(

if (context.Builder.Diagnostics
&& context.Project.AllowInconsistentDependencies == false
&& context.ProjectConfigurations.Any(c => ConfigurationNeedReferences(c)))
&& (context.ProjectConfigurations.Any(c => ConfigurationNeedReferences(c)) || context.Project.ForceReferencesExport))
{
CheckReferenceDependenciesConsistency(context);
}
Expand All @@ -1090,7 +1090,7 @@ private void GenerateProjectReferences(
? context.ProjectConfigurations.Any(c => ConfigurationNeedReferences(c))
: ConfigurationNeedReferences(firstConf);

if (addDependencies)
if (addDependencies || context.Project.ForceReferencesExport)
{
var dependencies = new UniqueList<ProjectDependencyInfo>();
foreach (var configuration in context.ProjectConfigurations)
Expand Down
9 changes: 9 additions & 0 deletions Sharpmake/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ public uint DependenciesOrder
// Setting this to true will force dependencies regardless of different output types.
public bool AllowInconsistentDependencies = false;

/// <summary>
/// Forces project references to be exported regardless of different output types.
/// </summary>
/// <remarks>
/// Sharpmake does not export project references for output types when it is unnecessary.
/// If you wish to export them, anyway, set this boolean to <c>true</c>.
/// </remarks>
public bool ForceReferencesExport = false;

private string _blobPath = "[project.SourceRootPath]" + Path.DirectorySeparatorChar + "blob";
public string BlobPath
{
Expand Down