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
945 stars 171 forks source link

Fix CustomFileBuildStep not working with static libraries under FastBuild #204

Closed doanamo closed 1 year ago

doanamo commented 2 years ago

CustomFileBuildStep targets were not being added to .PreBuildDependencies of Library() in BFF, only to Executable() and DLL(). Issue was only affecting FastBuild and not MSBuild. Added functional test cases for FastBuild that check if CustomFileBuildStep is working for all three types of projects.

We initially built our project using Sharpmake with MSBuild and this was one of the first issues that we encountered when we started transitioning to FastBuild.

Modifications to functional tests currently rely on Windows/MSVC because:

It seems that functional tests are only run on Windows (at least in CI), so please let me know if functional tests need to be able to run on other platforms.

I am not 100% sure if PostResolve is the best place to have logic for adding CustomFileBuildStep. I didn't use ConfigureAll because we need populated ResolvedSourceFiles here. Please advise if there is a better way. :)

Thanks!