-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performing a CMAKE build with CMAKE_BUILD_TYPE=Release generates godot-cpp template_debug artifacts #1697
Comments
Gentle ping to @enetheru who introduced these changes. |
I'll respond as soon as I can :) Thanks for reaching out. |
OK so to start with, there is a conflation between godot's debug_features, and a Debug build. To keep people's 4.3 code compiling, I made the godot::cpp alias point to godot-cpp::template_debug, which is the default build type when building SCons. At the time it seemed the most appropriate, let me know if you think it shouldnt be, perhaps failing might be less confusing. cmake/godotcpp.cmake:345 add_library( godot::cpp ALIAS godot-cpp.template_debug ) There are now three separate targets to choose to build against which match the options from SCons:
So in your code, some configurable switch, or a loop to build against these targets would be needed. test/CMakeLists.txt:19 foreach( TARGET_ALIAS template_debug template_release editor )
set( TARGET_NAME "godot-cpp.test.${TARGET_ALIAS}" )
set( LINK_TARGET "godot-cpp::${TARGET_ALIAS}" ) To summarise: template_debug and template_release are no longer related to CMAKE_BUILD_TYPE as they are conceptually separate things.
At the top of the windows.cmake I have detailed the reasoning behind the handling of the |
I've got a working orchestrator build at master for godot-cpp and orchestrator, my branch is https://github.com/enetheru/godot-orchestrator/tree/gdext-4.4 |
there is my pull request, related to that matter hanging there, awaiting workflow approval to run tests =) |
Thanks @enetheru, I've left two comments on the branch, one related to CMakeLists.txt and the other to the build profile. I think I figured out that the build profile allows you to narrow the godot-cpp sources that are compiled, so you can safely ignore that. |
@enetheru What is the reason to have all those targets? Especially I don't understand what use the IIUC, godot compiles with debug symbols with Also, correct me if I'm wrong, we can now compile with these options:
|
I'm ging to have to make some template answer for this at some point that I can copy paste I've explained it so many times. editor, template_debug and template_release are an abstraction layer up from Debug and Release. Debug/Release or dev_build=yes are for engine developers. editor, template_debug, template_release are for engine users.
This is all a reflection of the SCons build system target and how it effects godot-cpp. |
that abstraction explanation is poor let me try again.. holdup. |
Ignoring gdextension, addons are split into three categories, editor, template_release, template_debug. 'editor' for game developers creating games, 'template_release' for the final product, and 'template_debug' for when you want to debug the final product, or hand players debug versions to test with and report back with info without handing them editor tools. None of these have Debug Symbols, as they only rely on the editor, and gdscript. If you wanted Debug Symbols you would likely be working on the editor itself, and so I would categorise you as an engine developer, rather than a game developer. gdextension is general purpose, so you might be developing editor tools only that dont need to be distributed to players, or a plugin that can be used by game developers to then create, and distribute to players, or the whole game itself. As a result gdextensions ends up in the same situation as the editor, with the same requirements. |
@enetheru That makes a lot of sense! Thank you for the write up. I've dug quite a bit into this topic myself, and the picture is a lot clearer now. The One thing caught me off guard though, is that here it says |
Good spotting, I read through the SCons code to see. Looks like the docs are wrong, so I left a comment at the bottom for document writers. I certainly got caught out in the same trap when I started looking into this a year or so ago, took me a while to grok the difference in abstraction. And I've talked about it at least a dozen times in discord, and now here too. Such a waste of everyone's time from so small a thing. |
Godot version
4.4.beta1
godot-cpp version
4.4.beta1 sync hash dfc5196
System information
Windows 11
Issue description
When building the latest godot-cpp based on commit hash
dfc51960f9563c6df39a1a0ab66350374f932897
, CMAKE usestemplate_debug
although the parent project'sCMAKE_BUILD_TYPE
is set asRelease
, i.e.:I also confirmed the build type in my parent CMAKE as follows:
which outputs
In addition, here are some environment settings my build sets and outputs:
This creates a conflict between the godot-cpp and parent project based on flags such as
/MD
and/MT
, too. Is there a specific reason whytemplate_debug
is used or a way to influence this?UPDATE: I've also tried building against the latest master commit
3c55ca7a14cffbda60d1d587c965c5a09d02505d
and I observe exactly the same behavior.Steps to reproduce
Just building my plug-in Orchestrator that worked fine prior to the CMake modernization changes.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: