-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
CMake: Revert to single cmake target #1733
base: master
Are you sure you want to change the base?
Conversation
1f0370b
to
679b88b
Compare
9beadd2
to
4acb7ab
Compare
There's a long discussion here that led me to this PR, in which both ghuser404 and torets approved this direction |
As we discussed on Orchestrator's discord, I agree with moving back to a singular cmake target. In my experience, most IDE integrations for cmake are designed to be tightly coupled with a single profile that maps to a single CMAKE_BUILD_TYPE such as |
4acb7ab
to
58ace59
Compare
Things were getting messy so i remastered this, its no longer based on anything else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your explanation makes sense! I had a couple notes below, but I'm fine with going this direction in general.
It sounds like this also addresses the "default target" thing that a couple of folks have brought up, but in a slightly different way.
I attempted to test this locally, and it does seem to build fine!
(However, I'm having some unrelated issue locally where the unit tests are always crashing with stack smashing detected
when using a build from CMake, but not from SCons. I'm not sure of the cause, but it doesn't appear to be connected with these changes - I get the problem even when reverting to older versions of godot-cpp that I'm pretty sure I tested in the past, so I'm suspecting something local to my system?)
Is your system something I can replicate? or remote into? I don't like having issues that go unexplained if I can help in some way. |
I made issue #1741 - I'm hoping someone else on Linux can test it and see if it's just me or not :-) |
58ace59
to
98d0777
Compare
@dsnopek Updated with requested changes. |
Add GODOTCPP_TARGET configuration option Remove loop to generate the godot-cpp.<target> CMake Targets Rename test bindings target Update documentation
98d0777
to
89abe15
Compare
re-mastered:
I've had this thought stuck in my head for a day or so, and a lingering doubt that I might be able to put to rest.
When I embarked on bringing godot-cpp cmake upto a more modern approach it was hard to grasp how it might fit into a standard cmake script. The way I initially thought about it was as three separate libraries, template_debug, template_release and editor.
This is why I made the solution create the three targets, so that users could configure and link to any of the targets they choose.
The latest thought is that this was a mistake on my part, there is only one library, and target is simply a configuration variable.
The output name is just an artifact of convenience and doesnt denote a separate library, but rather a separate configuration of the same library. I conflated terminology differences between the scons configuration and cmake and managed to turn godot target into cmake build target.
My mistaken choice has led to some confusion about the default target, and caused a departure from the synchonicity with SCons.
This PR is painful for me to make and I feel like it might be annoying or disruptive, I'm sorry for that.
Changes:
In all other respects the cmake code is the same, and the work I have put into the whole thing remains intact and useful.
Configure and build commands would look like: