godot
godot copied to clipboard
Generated Visual Studio project can only build "Editor x64" configuration
Tested versions
- Reproducible in 4.3
- Not reproducible in 4.2
System information
Windows 10, Visual Studio 2022 Community
Issue description
The solution and project files generated using the scons vsproj=yes are only able to build the "editor" configuration on x64 architecture. Any other configuration ("template_debug", "template_release") and x86 are unable to build the program using IDE.
Steps to reproduce
- Open terminal of your choice in the root directory of the Godot 4.3 source code
- Execute
scons vsproj=yesand wait - Open the godot.sln generated file using Visual Studio
- Notice that you are able to build the project using default settings
- Change the configuration to "template_debug" and try to build it
- Notice following warning in the log: "warning MSB8005: The property 'NMakeBuildCommandLine' is not defined. Skipping...
- Notice that only godot.windows.editor.x86_64.generated.props was generated (I'm assuming the files for other valid platforms/configurations should also be generated as it contains required NMake commands)
Minimal reproduction project (MRP)
N/A
Okay, Actually this is not a problem, I figured out the solution, You have to tell the scons to generate for specific platform, So to generate props for template x64 you need to do this :
scons platform=windows target=template_release arch=x86_64 vsproj=yes
and it will generate godot.windows.template_release.x86_64.generated.props then reopen your solution and it will build just fine.
You have to tell the scons to generate for specific platform, So to generate props for template x64 you need to do this :
Couldn't the generated .sln include all configurations automatically? This would make more sense to me, although you'd need to change the list of solutions that are built when pressing the keyboard shortcut so that you only build one at a time.
although you'd need to change the list of solutions that are built when pressing the keyboard shortcut so that you only build one at a time.
Not sure what you mean by shortcut keyboard and building only one build at once.
So to generate props for template x64 you need to do this :
OK so there's a workaround, but you still have a case that generated files are only able to build whatever configurtation/platform was set when the scons vsproj=yes was executed, the reason why the workaround works is that old files aren't deleted when new solution is created. I still think this behavior is a bug or an oversight which needs to be resolved, but the description is incorrect as it implies only editor is buildable. So something like: "Generated Visual Studio project can only build default configuration" Unless this new behavior is by design, but I'd argue it makes more sense to have one sln for all platforms and configurations.
Couldn't the generated
.slninclude all configurations automatically? This would make more sense to me, although you'd need to change the list of solutions that are built when pressing the keyboard shortcut so that you only build one at a time.
@Calinou generated .sln doesn't contain reference to props, .vcxproj does and it contains all of the platforms and all included, the issue is generated .generated.props files which are generated as a single one per vsproj=yes request, So I just made a bat to generate all required ones, .sln and .vcxproj doesn't need to be touched.
@DrRevert Just do this in a row
scons platform=windows target=template_debug arch=x86_64 vsproj=yes
scons platform=windows target=template_release arch=x86_64 vsproj=yes
scons platform=windows target=editor arch=x86_64 vsproj=yes
Then open last generated .sln file and you have all of them and you can build all with no problem.