From 9ba73ab1237a090d7db541829e238cfce2e786cd Mon Sep 17 00:00:00 2001 From: ShawnCZek Date: Fri, 30 Sep 2022 10:30:31 +0200 Subject: [PATCH 1/3] Add option to force project references export --- Sharpmake.Generators/VisualStudio/Vcxproj.cs | 4 ++-- Sharpmake/Project.cs | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Sharpmake.Generators/VisualStudio/Vcxproj.cs b/Sharpmake.Generators/VisualStudio/Vcxproj.cs index c1b2191a7..e0affb763 100644 --- a/Sharpmake.Generators/VisualStudio/Vcxproj.cs +++ b/Sharpmake.Generators/VisualStudio/Vcxproj.cs @@ -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); } @@ -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(); foreach (var configuration in context.ProjectConfigurations) diff --git a/Sharpmake/Project.cs b/Sharpmake/Project.cs index 1c591db94..89aeb9349 100644 --- a/Sharpmake/Project.cs +++ b/Sharpmake/Project.cs @@ -262,6 +262,15 @@ public uint DependenciesOrder // Setting this to true will force dependencies regardless of different output types. public bool AllowInconsistentDependencies = false; + /// + /// Forces project references to be exported regardless of different output types. + /// + /// + /// Sharpmake does not export project references for output types when it is unnecessary. + /// If you wish to export them, anyway, set this boolean to true. + /// + public bool ForceReferencesExport = false; + private string _blobPath = "[project.SourceRootPath]" + Path.DirectorySeparatorChar + "blob"; public string BlobPath { From 027386d5aff9c95f26878811cb432c69350e1017 Mon Sep 17 00:00:00 2001 From: ShawnCZek Date: Sun, 9 Mar 2025 21:50:49 +0100 Subject: [PATCH 2/3] Add an example with a forced export of project references. Disabling the project references forced export makes the solution fail to compile because of the shared precompiled header dependency. --- SamplesDef.json | 14 + .../ProjectReferencesExport.sharpmake.cs | 139 ++++++++++ .../DependantProject/include/dependant.h | 3 + .../DependantProject/src/dependant.cpp | 8 + .../codebase/FooBarProject/include/foobar.h | 3 + .../codebase/FooBarProject/include/stdafx.h | 3 + .../codebase/FooBarProject/src/foobar.cpp | 7 + .../codebase/FooBarProject/src/stdafx.cpp | 1 + .../codebase/MainProject/src/main.cpp | 8 + .../dependantproject_vs2022_win64.vcxproj | 208 +++++++++++++++ ...endantproject_vs2022_win64.vcxproj.filters | 21 ++ .../foobarproject_vs2022_win64.vcxproj | 204 ++++++++++++++ ...foobarproject_vs2022_win64.vcxproj.filters | 27 ++ .../projects/mainproject_vs2022_win64.vcxproj | 250 ++++++++++++++++++ .../mainproject_vs2022_win64.vcxproj.filters | 13 + .../projectreferencesexport_vs2022_win64.sln | 31 +++ samples/Properties/launchSettings.json | 8 +- 17 files changed, 947 insertions(+), 1 deletion(-) create mode 100644 samples/ProjectReferencesExport/ProjectReferencesExport.sharpmake.cs create mode 100644 samples/ProjectReferencesExport/codebase/DependantProject/include/dependant.h create mode 100644 samples/ProjectReferencesExport/codebase/DependantProject/src/dependant.cpp create mode 100644 samples/ProjectReferencesExport/codebase/FooBarProject/include/foobar.h create mode 100644 samples/ProjectReferencesExport/codebase/FooBarProject/include/stdafx.h create mode 100644 samples/ProjectReferencesExport/codebase/FooBarProject/src/foobar.cpp create mode 100644 samples/ProjectReferencesExport/codebase/FooBarProject/src/stdafx.cpp create mode 100644 samples/ProjectReferencesExport/codebase/MainProject/src/main.cpp create mode 100644 samples/ProjectReferencesExport/reference/projects/dependantproject_vs2022_win64.vcxproj create mode 100644 samples/ProjectReferencesExport/reference/projects/dependantproject_vs2022_win64.vcxproj.filters create mode 100644 samples/ProjectReferencesExport/reference/projects/foobarproject_vs2022_win64.vcxproj create mode 100644 samples/ProjectReferencesExport/reference/projects/foobarproject_vs2022_win64.vcxproj.filters create mode 100644 samples/ProjectReferencesExport/reference/projects/mainproject_vs2022_win64.vcxproj create mode 100644 samples/ProjectReferencesExport/reference/projects/mainproject_vs2022_win64.vcxproj.filters create mode 100644 samples/ProjectReferencesExport/reference/projects/projectreferencesexport_vs2022_win64.sln diff --git a/SamplesDef.json b/SamplesDef.json index ca806929e..706f8f231 100644 --- a/SamplesDef.json +++ b/SamplesDef.json @@ -333,6 +333,20 @@ "&'./{testFolder}/projects/cpppackagereferences/output/{VsVersionSuffix}/{configuration}/cpppackagereferences.exe'" ] }, + { + "Name": "ProjectReferencesExport", + "CIs": [ "github", "gitlab" ], + "OSs": [ "windows-2022" ], + "Frameworks": [ "net6.0" ], + "Configurations": [ "debug", "release" ], + "TestFolder": "samples/ProjectReferencesExport", + "Commands": + [ + "./RunSharpmake.ps1 -workingDirectory {testFolder} -sharpmakeFile \"ProjectReferencesExport.sharpmake.cs\" -framework {framework}", + "./Compile.ps1 -slnOrPrjFile \"ProjectReferencesExportSolution_{VsVersionSuffix}_win64.sln\" -configuration {configuration} -platform \"x64\" -WorkingDirectory \"{testFolder}/projects\" -VsVersion {os} -compiler MsBuild", + "&'./{testFolder}/projects/MainProject/output/{VsVersionSuffix}/{configuration}/MainProject.exe'" + ] + }, { "Name": "QTFileCustomBuild", "CIs": [], diff --git a/samples/ProjectReferencesExport/ProjectReferencesExport.sharpmake.cs b/samples/ProjectReferencesExport/ProjectReferencesExport.sharpmake.cs new file mode 100644 index 000000000..63906bd06 --- /dev/null +++ b/samples/ProjectReferencesExport/ProjectReferencesExport.sharpmake.cs @@ -0,0 +1,139 @@ +// Copyright (c) Ubisoft. All Rights Reserved. +// Licensed under the Apache 2.0 License. See LICENSE.md in the project root for license information. + +using System.IO; +using Sharpmake; + +namespace ProjectReferencesExport +{ + public partial class BaseProject : Project + { + public BaseProject() + { + AddTargets(new Target(Platform.win64, DevEnv.vs2022, Optimization.Debug | Optimization.Release)); + SourceRootPath = @"[project.SharpmakeCsPath]\codebase\[project.Name]"; + } + + [Configure] + public void ConfigureAll(Configuration conf, Target target) + { + conf.ProjectPath = @"[project.SharpmakeCsPath]\projects"; + conf.ProjectFileName = "[project.Name]_[target.DevEnv]_[target.Platform]"; + + conf.IntermediatePath = @"[conf.ProjectPath]\obj\[project.Name]\[target.Platform]\[target.Name]"; + + conf.IncludePaths.Add(@"[project.SourceRootPath]\include"); + conf.IncludePrivatePaths.Add(@"[project.SourceRootPath]\src"); + + conf.Options.Add(Options.Vc.Compiler.Exceptions.Enable); + } + } + + [Sharpmake.Generate] + public class FooBarProject : BaseProject + { + [Configure] + public void ConfigureOutput(Configuration conf, Target target) + { + conf.Output = Configuration.OutputType.Lib; + } + + [Configure] + public void ConfigurePrecompHeader(Configuration conf, Target target) + { + conf.PrecompHeader = "stdafx.h"; + conf.PrecompSource = "stdafx.cpp"; + } + } + + [Sharpmake.Generate] + public class DependantProject : BaseProject + { + public DependantProject() + { + ForceReferencesExport = true; + } + + [Configure] + public void ConfigureDependencies(Configuration conf, Target target) + { + conf.AddPrivateDependency(target); + } + + [Configure] + public void ConfigureOutput(Configuration conf, Target target) + { + conf.Output = Configuration.OutputType.Lib; + } + + public override void PostLink() + { + base.PostLink(); + ConfigureSharedPrecompiledHeader(); + } + + internal void ConfigureSharedPrecompiledHeader() + { + foreach (Configuration conf in Configurations) + { + var dependency = Builder.Instance.GetProject(typeof(FooBarProject)); + var dependencyConf = dependency.GetConfiguration(conf.Target); + + conf.CompilerPdbFilePath = dependencyConf.CompilerPdbFilePath; + + string sourceRoot = Util.PathGetRelative(SourceRootPath, dependency.SourceRootPath); + string header = Path.Combine(sourceRoot, dependencyConf.PrecompHeader); + + conf.PrecompHeader = header; + conf.PrecompSource = "use"; + + conf.ForcedIncludes.Add(header); + + conf.PrecompHeaderOutputFolder = Util.PathGetRelative(conf.ProjectPath, dependencyConf.IntermediatePath); + conf.PrecompHeaderOutputFile = $"{dependencyConf.ProjectName}.pch"; + } + } + } + + [Sharpmake.Generate] + public class MainProject : BaseProject + { + [Configure] + public void ConfigureDependencies(Configuration conf, Target target) + { + conf.AddPrivateDependency(target); + conf.AddPrivateDependency(target); + } + } + + [Sharpmake.Generate] + public class ProjectReferencesExportSolution : Sharpmake.Solution + { + public ProjectReferencesExportSolution() + { + Name = "ProjectReferencesExport"; + AddTargets(new Target(Platform.win64, DevEnv.vs2022, Optimization.Debug | Optimization.Release)); + } + + [Configure] + public void ConfigureAll(Configuration conf, Target target) + { + conf.SolutionFileName = "[solution.Name]_[target.DevEnv]_[target.Platform]"; + conf.SolutionPath = @"[solution.SharpmakeCsPath]\projects"; + conf.AddProject(target); + conf.AddProject(target); + conf.AddProject(target); + } + } + + public static class Main + { + [Sharpmake.Main] + public static void SharpmakeMain(Sharpmake.Arguments arguments) + { + KitsRootPaths.SetUseKitsRootForDevEnv(DevEnv.vs2022, KitsRootEnum.KitsRoot10, Options.Vc.General.WindowsTargetPlatformVersion.v10_0_19041_0); + + arguments.Generate(); + } + } +} diff --git a/samples/ProjectReferencesExport/codebase/DependantProject/include/dependant.h b/samples/ProjectReferencesExport/codebase/DependantProject/include/dependant.h new file mode 100644 index 000000000..166d22ce0 --- /dev/null +++ b/samples/ProjectReferencesExport/codebase/DependantProject/include/dependant.h @@ -0,0 +1,3 @@ +#pragma once + +std::string get_string(); diff --git a/samples/ProjectReferencesExport/codebase/DependantProject/src/dependant.cpp b/samples/ProjectReferencesExport/codebase/DependantProject/src/dependant.cpp new file mode 100644 index 000000000..119763274 --- /dev/null +++ b/samples/ProjectReferencesExport/codebase/DependantProject/src/dependant.cpp @@ -0,0 +1,8 @@ +#include +#include "dependant.h" +#include "foobar.h" + +std::string get_string() +{ + return "Hello " + get_name() + "!"; +} diff --git a/samples/ProjectReferencesExport/codebase/FooBarProject/include/foobar.h b/samples/ProjectReferencesExport/codebase/FooBarProject/include/foobar.h new file mode 100644 index 000000000..ebc703100 --- /dev/null +++ b/samples/ProjectReferencesExport/codebase/FooBarProject/include/foobar.h @@ -0,0 +1,3 @@ +#pragma once + +std::string get_name(); diff --git a/samples/ProjectReferencesExport/codebase/FooBarProject/include/stdafx.h b/samples/ProjectReferencesExport/codebase/FooBarProject/include/stdafx.h new file mode 100644 index 000000000..dad5802eb --- /dev/null +++ b/samples/ProjectReferencesExport/codebase/FooBarProject/include/stdafx.h @@ -0,0 +1,3 @@ +#pragma once + +#include diff --git a/samples/ProjectReferencesExport/codebase/FooBarProject/src/foobar.cpp b/samples/ProjectReferencesExport/codebase/FooBarProject/src/foobar.cpp new file mode 100644 index 000000000..3cbb7d161 --- /dev/null +++ b/samples/ProjectReferencesExport/codebase/FooBarProject/src/foobar.cpp @@ -0,0 +1,7 @@ +#include "stdafx.h" +#include "foobar.h" + +std::string get_name() +{ + return "world"; +} diff --git a/samples/ProjectReferencesExport/codebase/FooBarProject/src/stdafx.cpp b/samples/ProjectReferencesExport/codebase/FooBarProject/src/stdafx.cpp new file mode 100644 index 000000000..fd4f341c7 --- /dev/null +++ b/samples/ProjectReferencesExport/codebase/FooBarProject/src/stdafx.cpp @@ -0,0 +1 @@ +#include "stdafx.h" diff --git a/samples/ProjectReferencesExport/codebase/MainProject/src/main.cpp b/samples/ProjectReferencesExport/codebase/MainProject/src/main.cpp new file mode 100644 index 000000000..a2b5879c5 --- /dev/null +++ b/samples/ProjectReferencesExport/codebase/MainProject/src/main.cpp @@ -0,0 +1,8 @@ +#include +#include "dependant.h" + +int main(int, char**) +{ + std::cout << get_string() << std::endl; + return 0; +} diff --git a/samples/ProjectReferencesExport/reference/projects/dependantproject_vs2022_win64.vcxproj b/samples/ProjectReferencesExport/reference/projects/dependantproject_vs2022_win64.vcxproj new file mode 100644 index 000000000..491374d3e --- /dev/null +++ b/samples/ProjectReferencesExport/reference/projects/dependantproject_vs2022_win64.vcxproj @@ -0,0 +1,208 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {09E017FE-C28E-E929-9607-E0ECFBF61EAE} + en-US + DependantProject + DependantProject + + + 10.0.19041.0 + + + + StaticLibrary + true + MultiByte + false + v143 + + + StaticLibrary + false + MultiByte + false + v143 + + + + + + + + + + dependantproject + output\win64\debug\ + obj\dependantproject\win64\debug\ + .lib + true + false + output\win64\debug\dependantproject.lib + false + + + dependantproject + output\win64\release\ + obj\dependantproject\win64\release\ + .lib + true + false + output\win64\release\dependantproject.lib + false + + + + Use + Level4 + Disabled + WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions);$(PreprocessorDefinitions) + ..\codebase\dependantproject\include;..\codebase\dependantproject\src;..\codebase\foobarproject\include + ProgramDatabase + true + false + true + false + OnlyExplicitInline + true + Neither + false + false + false + false + false + false + false + false + true + Sync + false + Default + MultiThreadedDebug + Default + true + false + NotSet + Fast + false + false + true + true + false + false + false + NoListing + false + false + Cdecl + Default + /Zc:__cplusplus + ..\foobarproject\stdafx.h + obj\foobarproject\win64\debug\FooBarProject.pch + obj\foobarproject\win64\debug\foobarproject_compiler.pdb + MultiThreadedDebug + ..\foobarproject\stdafx.h + + + true + false + false + + + MachineX64 + + false + output\win64\debug\dependantproject.lib + + + + + Use + Level4 + Full + NDEBUG;WIN64;_LIB;%(PreprocessorDefinitions);$(PreprocessorDefinitions) + ..\codebase\dependantproject\include;..\codebase\dependantproject\src;..\codebase\foobarproject\include + ProgramDatabase + true + false + true + false + AnySuitable + true + Speed + false + false + false + false + false + false + false + false + true + Sync + false + Default + MultiThreaded + Default + false + true + NotSet + Fast + false + false + true + true + false + false + false + NoListing + false + false + Cdecl + Default + /Zc:__cplusplus + ..\foobarproject\stdafx.h + obj\foobarproject\win64\release\FooBarProject.pch + obj\foobarproject\win64\release\foobarproject_compiler.pdb + MultiThreaded + ..\foobarproject\stdafx.h + + + true + true + true + + + MachineX64 + + false + output\win64\release\dependantproject.lib + + + + + + + + + + + + + + {45D32931-E284-AE61-F9BA-FFDD70A2BD5F} + false + false + + + diff --git a/samples/ProjectReferencesExport/reference/projects/dependantproject_vs2022_win64.vcxproj.filters b/samples/ProjectReferencesExport/reference/projects/dependantproject_vs2022_win64.vcxproj.filters new file mode 100644 index 000000000..77e161316 --- /dev/null +++ b/samples/ProjectReferencesExport/reference/projects/dependantproject_vs2022_win64.vcxproj.filters @@ -0,0 +1,21 @@ + + + + + src + + + + + include + + + + + {0feb36d4-ded9-b510-4a82-8ce6435f7e81} + + + {c202d925-8342-8cab-fbac-54dfa101ad31} + + + \ No newline at end of file diff --git a/samples/ProjectReferencesExport/reference/projects/foobarproject_vs2022_win64.vcxproj b/samples/ProjectReferencesExport/reference/projects/foobarproject_vs2022_win64.vcxproj new file mode 100644 index 000000000..1ed195c58 --- /dev/null +++ b/samples/ProjectReferencesExport/reference/projects/foobarproject_vs2022_win64.vcxproj @@ -0,0 +1,204 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {45D32931-E284-AE61-F9BA-FFDD70A2BD5F} + en-US + FooBarProject + FooBarProject + + + 10.0.19041.0 + + + + StaticLibrary + true + MultiByte + false + v143 + + + StaticLibrary + false + MultiByte + false + v143 + + + + + + + + + + foobarproject + output\win64\debug\ + obj\foobarproject\win64\debug\ + .lib + true + false + output\win64\debug\foobarproject.lib + false + + + foobarproject + output\win64\release\ + obj\foobarproject\win64\release\ + .lib + true + false + output\win64\release\foobarproject.lib + false + + + + Use + Level4 + Disabled + WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions);$(PreprocessorDefinitions) + ..\codebase\foobarproject\include;..\codebase\foobarproject\src + ProgramDatabase + true + false + true + false + OnlyExplicitInline + true + Neither + false + false + false + false + false + false + false + false + true + Sync + false + Default + MultiThreadedDebug + Default + true + false + NotSet + Fast + false + false + true + true + false + false + false + NoListing + false + false + Cdecl + Default + /Zc:__cplusplus + stdafx.h + obj\foobarproject\win64\debug\FooBarProject.pch + obj\foobarproject\win64\debug\foobarproject_compiler.pdb + MultiThreadedDebug + + + true + false + false + + + MachineX64 + + false + output\win64\debug\foobarproject.lib + + + + + Use + Level4 + Full + NDEBUG;WIN64;_LIB;%(PreprocessorDefinitions);$(PreprocessorDefinitions) + ..\codebase\foobarproject\include;..\codebase\foobarproject\src + ProgramDatabase + true + false + true + false + AnySuitable + true + Speed + false + false + false + false + false + false + false + false + true + Sync + false + Default + MultiThreaded + Default + false + true + NotSet + Fast + false + false + true + true + false + false + false + NoListing + false + false + Cdecl + Default + /Zc:__cplusplus + stdafx.h + obj\foobarproject\win64\release\FooBarProject.pch + obj\foobarproject\win64\release\foobarproject_compiler.pdb + MultiThreaded + + + true + true + true + + + MachineX64 + + false + output\win64\release\foobarproject.lib + + + + + + + + + + Create + Create + + + + + + diff --git a/samples/ProjectReferencesExport/reference/projects/foobarproject_vs2022_win64.vcxproj.filters b/samples/ProjectReferencesExport/reference/projects/foobarproject_vs2022_win64.vcxproj.filters new file mode 100644 index 000000000..dfb29d591 --- /dev/null +++ b/samples/ProjectReferencesExport/reference/projects/foobarproject_vs2022_win64.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + src + + + src + + + + + include + + + include + + + + + {0feb36d4-ded9-b510-4a82-8ce6435f7e81} + + + {c202d925-8342-8cab-fbac-54dfa101ad31} + + + \ No newline at end of file diff --git a/samples/ProjectReferencesExport/reference/projects/mainproject_vs2022_win64.vcxproj b/samples/ProjectReferencesExport/reference/projects/mainproject_vs2022_win64.vcxproj new file mode 100644 index 000000000..3f2973608 --- /dev/null +++ b/samples/ProjectReferencesExport/reference/projects/mainproject_vs2022_win64.vcxproj @@ -0,0 +1,250 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {56A3D9AE-B19C-91EF-7C11-FD0A7F9A27D1} + en-US + MainProject + MainProject + + + 10.0.19041.0 + + + + Application + true + MultiByte + false + v143 + + + Application + false + MultiByte + false + v143 + + + + + + + + + + mainproject + output\win64\debug\ + obj\mainproject\win64\debug\ + .exe + true + false + output\win64\debug\mainproject.exe + false + + + mainproject + output\win64\release\ + obj\mainproject\win64\release\ + .exe + true + false + output\win64\release\mainproject.exe + false + + + + NotUsing + Level4 + Disabled + WIN64;_CONSOLE;_DEBUG;%(PreprocessorDefinitions);$(PreprocessorDefinitions) + ..\codebase\dependantproject\include;..\codebase\foobarproject\include;..\codebase\mainproject\include;..\codebase\mainproject\src + ProgramDatabase + true + false + true + false + OnlyExplicitInline + true + Neither + false + false + false + false + false + false + false + false + true + Sync + false + Default + MultiThreadedDebug + Default + true + false + NotSet + Fast + false + false + true + true + false + false + false + NoListing + false + false + Cdecl + Default + /Zc:__cplusplus + obj\mainproject\win64\debug\mainproject_compiler.pdb + MultiThreadedDebug + + + Console + true + output\win64\debug\mainproject.exe + NotSet + output\win64\debug + output\win64\debug\mainproject.pdb + true + false + false + false + NotSet + false + false + + + Default + false + 1 + false + false + false + MachineX64 + false + Default + PromptImmediately + dependantproject.lib;foobarproject.lib;%(AdditionalDependencies) + true + false + + true + output\win64\debug\mainproject.map + + + + + NotUsing + Level4 + Full + NDEBUG;WIN64;_CONSOLE;%(PreprocessorDefinitions);$(PreprocessorDefinitions) + ..\codebase\dependantproject\include;..\codebase\foobarproject\include;..\codebase\mainproject\include;..\codebase\mainproject\src + ProgramDatabase + true + false + true + false + AnySuitable + true + Speed + false + false + false + false + false + false + false + false + true + Sync + false + Default + MultiThreaded + Default + false + true + NotSet + Fast + false + false + true + true + false + false + false + NoListing + false + false + Cdecl + Default + /Zc:__cplusplus + obj\mainproject\win64\release\mainproject_compiler.pdb + MultiThreaded + + + Console + true + output\win64\release\mainproject.exe + NotSet + output\win64\release + output\win64\release\mainproject.pdb + true + false + false + false + NotSet + true + true + + + Default + false + 1 + false + false + false + MachineX64 + false + Default + PromptImmediately + dependantproject.lib;foobarproject.lib;%(AdditionalDependencies) + true + false + + true + output\win64\release\mainproject.map + + + + + + + + + + + + + {09E017FE-C28E-E929-9607-E0ECFBF61EAE} + false + false + + + {45D32931-E284-AE61-F9BA-FFDD70A2BD5F} + false + false + + + diff --git a/samples/ProjectReferencesExport/reference/projects/mainproject_vs2022_win64.vcxproj.filters b/samples/ProjectReferencesExport/reference/projects/mainproject_vs2022_win64.vcxproj.filters new file mode 100644 index 000000000..e62400970 --- /dev/null +++ b/samples/ProjectReferencesExport/reference/projects/mainproject_vs2022_win64.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + src + + + + + {c202d925-8342-8cab-fbac-54dfa101ad31} + + + \ No newline at end of file diff --git a/samples/ProjectReferencesExport/reference/projects/projectreferencesexport_vs2022_win64.sln b/samples/ProjectReferencesExport/reference/projects/projectreferencesexport_vs2022_win64.sln new file mode 100644 index 000000000..debe2679f --- /dev/null +++ b/samples/ProjectReferencesExport/reference/projects/projectreferencesexport_vs2022_win64.sln @@ -0,0 +1,31 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MainProject", "mainproject_vs2022_win64.vcxproj", "{56A3D9AE-B19C-91EF-7C11-FD0A7F9A27D1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DependantProject", "dependantproject_vs2022_win64.vcxproj", "{09E017FE-C28E-E929-9607-E0ECFBF61EAE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FooBarProject", "foobarproject_vs2022_win64.vcxproj", "{45D32931-E284-AE61-F9BA-FFDD70A2BD5F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {56A3D9AE-B19C-91EF-7C11-FD0A7F9A27D1}.Debug|x64.ActiveCfg = Debug|x64 + {56A3D9AE-B19C-91EF-7C11-FD0A7F9A27D1}.Debug|x64.Build.0 = Debug|x64 + {56A3D9AE-B19C-91EF-7C11-FD0A7F9A27D1}.Release|x64.ActiveCfg = Release|x64 + {56A3D9AE-B19C-91EF-7C11-FD0A7F9A27D1}.Release|x64.Build.0 = Release|x64 + {09E017FE-C28E-E929-9607-E0ECFBF61EAE}.Debug|x64.ActiveCfg = Debug|x64 + {09E017FE-C28E-E929-9607-E0ECFBF61EAE}.Debug|x64.Build.0 = Debug|x64 + {09E017FE-C28E-E929-9607-E0ECFBF61EAE}.Release|x64.ActiveCfg = Release|x64 + {09E017FE-C28E-E929-9607-E0ECFBF61EAE}.Release|x64.Build.0 = Release|x64 + {45D32931-E284-AE61-F9BA-FFDD70A2BD5F}.Debug|x64.ActiveCfg = Debug|x64 + {45D32931-E284-AE61-F9BA-FFDD70A2BD5F}.Debug|x64.Build.0 = Debug|x64 + {45D32931-E284-AE61-F9BA-FFDD70A2BD5F}.Release|x64.ActiveCfg = Release|x64 + {45D32931-E284-AE61-F9BA-FFDD70A2BD5F}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/Properties/launchSettings.json b/samples/Properties/launchSettings.json index 3decf803c..7db2d1ec0 100644 --- a/samples/Properties/launchSettings.json +++ b/samples/Properties/launchSettings.json @@ -138,6 +138,12 @@ "commandLineArgs": "/sources(@'PackageReferences.sharpmake.cs')", "workingDirectory": "$(ProjectDir)\\PackageReferences" }, + "Sample (ProjectReferencesExport)": { + "commandName": "Executable", + "executablePath": "$(ProjectDir)\\..\\Sharpmake.Application\\bin\\$(Configuration)\\$(TargetFramework)\\Sharpmake.Application.exe", + "commandLineArgs": "/sources(@'ProjectReferencesExport.sharpmake.cs')", + "workingDirectory": "$(ProjectDir)\\ProjectReferencesExport" + }, "Sample (QTFileCustomBuild)": { "commandName": "Executable", "executablePath": "$(ProjectDir)\\..\\Sharpmake.Application\\bin\\$(Configuration)\\$(TargetFramework)\\Sharpmake.Application.exe", @@ -163,4 +169,4 @@ "workingDirectory": "$(ProjectDir)\\XCodeProjects" } } -} \ No newline at end of file +} From c0b420ecf393732a0d684fd1b9406d06d1d28336 Mon Sep 17 00:00:00 2001 From: ShawnCZek Date: Sun, 9 Mar 2025 22:00:53 +0100 Subject: [PATCH 3/3] Fix running the ProjectReferencesExport sample. --- SamplesDef.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SamplesDef.json b/SamplesDef.json index 706f8f231..7124bf5e4 100644 --- a/SamplesDef.json +++ b/SamplesDef.json @@ -343,8 +343,8 @@ "Commands": [ "./RunSharpmake.ps1 -workingDirectory {testFolder} -sharpmakeFile \"ProjectReferencesExport.sharpmake.cs\" -framework {framework}", - "./Compile.ps1 -slnOrPrjFile \"ProjectReferencesExportSolution_{VsVersionSuffix}_win64.sln\" -configuration {configuration} -platform \"x64\" -WorkingDirectory \"{testFolder}/projects\" -VsVersion {os} -compiler MsBuild", - "&'./{testFolder}/projects/MainProject/output/{VsVersionSuffix}/{configuration}/MainProject.exe'" + "./Compile.ps1 -slnOrPrjFile \"projectreferencesexport_{VsVersionSuffix}_win64.sln\" -configuration {configuration} -platform \"x64\" -WorkingDirectory \"{testFolder}/projects\" -VsVersion {os} -compiler MsBuild", + "&'./{testFolder}/projects/output/win64/{configuration}/mainproject.exe'" ] }, {