ubisoft / Sharpmake

Sharpmake is an open-source C#-based solution for generating project definition files, such as Visual Studio projects and solutions, GNU makefiles, Xcode projects, etc.
Apache License 2.0
927 stars 171 forks source link

Having Project Dependencies visible on Visual Studio? #284

Open soufianekhiat opened 1 year ago

soufianekhiat commented 1 year ago

Do we have a way to have Project Dependencies visible on Visual Studio, I tried AddPublicDependency and AddPrivateDependency: image

jspelletier commented 1 year ago

Hello Soufiane,

You must be doing something wrong in your configuration because it should be working. Here is a screenshot of a msbuild based project I have that is managed by Sharpmake.

image

Are you passing special parameters to your AddPublicDependencies ? Could you paste some code here showing the way you are adding your dependencies? These are C++ projects, right ?

Thanks JS

sylvainfortin commented 1 year ago

It might not be your case, but I encountered a similar case a few years ago and was also surprise at first. If your project output a static library, it does not need the results of its static dependencies to compile itself. I believe Sharpmake omit the project dependency in this case to improve compilation time. It enable the MSBuild engine to compile your projects in parallel.

soufianekhiat commented 1 year ago

Hi JS,

For info, I'm using "sharpmake 0.20.0". I have nothing special:

conf.AddPublicDependency< KernelProject    >( target );
conf.AddPublicDependency< CoreProject      >( target );
conf.AddPublicDependency< MathProject      >( target );
conf.AddPublicDependency< MantleProject    >( target );
conf.AddPublicDependency< ScalerProject    >( target );
conf.AddPublicDependency< ImUIProject      >( target );

conf.AddPublicDependency< RegistersProject >( target );

All projects are C++, Core, Kernel, Math, Scalar, Mantle, ImUI, Brain, Registers, Package.SDK are static lib Package.Internal.Core is a DLL and eMVClass and eMVEditor are *.exe

jspelletier commented 1 year ago

Hello,

In the screenshot I posted, sandbox is an exe and the 3 checked projects are static libs.

I suggest you upgrade to latest version, maybe we fixed a bug a while ago.

soufianekhiat commented 1 year ago

I updated to "0.21.0" Still amazed about how fast is it compare to CMake ( :

  Results:
    projects  (  720 configurations)   131 generated,     0 up-to-date
    solutions (   10 configurations)     0 generated,     5 up-to-date
  time: 4.43 sec.

My dependencies are Kernel <- {Core, Math, eMVClass} Core <- {Scaler, Mantle, Brain, eMVClass} Math <- Brain Scaler <- Mantle Mantle <- Brain Brain <- {Registers, ImUI} Registers <- PackageSDK PackageSDK <- {PackageInternalCore, eMVEditor} PackageInternalCore <- eMVEditor

And the dependencies on the build order became: image

Dependencies for instance for Core: image

And for eMVEditor: image

Maybe I missed something.