Fix custom modules in external directories not being included in vsproj #112356
+50
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #91862 - if a custom_module is in a directory that is outside of the build directory, it is not included as part of the generated .vsproj project after building Godot with SCons.
This is merely adapted fix that was submitted previously as #94099 but never merged. The only part I have changed from the previous submission is between the lines 1169 to 1189 to use the "extensions" arrays rather than a separate for-cycle for each relevant extension; so it is mostly a cosmetic change. I do not know why the original submission was not merged, there is little communication about it, seems the original author simply deleted their repo before it could be integrated. My familiarity with godot build system is minimal, but I am affected by the issue and would like to see it solved, so I've submitted this and would welcome a thorough review.
It only modifies the generate_vs_project function, so I have tested it only with vsproj=yes, other functionality should not be affected. I have verified that the issue is resolved: opening the generated solution in MS Visual Studio shows the "external" module as any other module, e.g. with structure like:
godot.proj
--- Source Files/Header Files
------ modules
--------- mymodule
JetBrains's Rider seems to ignore the .filters file and does not show the external module it in the module folder, but rather as a completely separate folder:
godot.proj
--- modules
--- misc
--- main
......(other root folders)
--- mymodule
But at least it is now part of the solution, which it was not previously. Technically, it is correct since it is only showing the actual folder structure without the filters, so I don't think this has anything to do with this fix, rather with how Rider does (not) use the filters file (or it needs to be set up somehow and I don't know how).