You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CMake completely broken when trying to migrate from 4.3 to 4.4 #1739
4.4 completely broke my project's CMake, I have the following setup:
ADD_SUBDIRECTORY(godot-cpp) # godot-cpp as a submodule...TARGET_LINK_LIBRARIES(${PROJECT_NAME}PRIVATEgodot-cpp
)
I use warnings as errors and, with 4.4, my project is picking all the warnings that godot-cpp has, which is not happening in 4.3.
It seems the godot-cpp's CMake has global compile options that are affecting other dependencies, which was not happening before. I think compile options should be private for each project/dependency.
It also recompiles the entire godot-cpp every time I do a modification, which was also not happening in 4.3.
Steps to reproduce
Create a CMake project, clone godot-cpp and add it as a subdirectory.
I think I see the issue with the re-building, its related to how the sources are generate with the add_custom_target which is considered always out of date.
I will research how to do it without breaking the XCode dependency chain.
I've re-worked the XCode change to solve the re-building one since it goes hand in hand with the changes I needed to make there.
If these all pass review and merge, it will solve the re-building issue.
The timing of the 4.4-stable tagging and branching was a little unfortunate as the CMake interface needed changing which was merged in #1733 which I am going to petition to have cherry picked for 4.4 branch and have the tag updated asap. I recommend using master at least until #1733 gets cherry picked.
CMake thinks godot-cpp is your project and will assume you want to know about any warnings raised from includes and such.
Marking godot-cpp as SYSTEM changes the expression of the flags for the compiler so that it wont raise any warnings.
I can do a fresh configure/build with this change, where before it would error due to warnings raised from including godot-cpp headers.
Activity
enetheru commentedon Mar 10, 2025
I have a PR in the wings for changing options to PRIVATE. I'll clean it up and submit.
Why #1733 ? The PUBLIC/PRIVATE thing has been waiting to be fixed for a while.
enetheru commentedon Mar 10, 2025
here is the PR: #1740
jpxaraujo commentedon Mar 10, 2025
I tested with this PR and it's still failing.
Will test with #1740
enetheru commentedon Mar 11, 2025
I think I see the issue with the re-building, its related to how the sources are generate with the add_custom_target which is considered always out of date.
I will research how to do it without breaking the XCode dependency chain.
enetheru commentedon Mar 11, 2025
Ok I finally found a way around the XCode dependency chain issue. and as always It's simpler than expected.
here's my branch which I used for testing
https://github.com/enetheru/godot-cpp/tree/re-build
I have a bunch of PR's lined up already, I'll see if I can re-work the XCode one since its tightly related to the changes made in there.
enetheru commentedon Mar 11, 2025
I've re-worked the XCode change to solve the re-building one since it goes hand in hand with the changes I needed to make there.
If these all pass review and merge, it will solve the re-building issue.
jpxaraujo commentedon Mar 16, 2025
I don't know why this was closed, it's not totally fixed.
I made an example repository here:
https://github.com/jpxaraujo/godot-4.4-test
If you change the godot-cpp branch to godot-4.3-stable and run the compile.sh, it works.
But if you change to the master branch, it still fails due to propagation of warnings.
@enetheru @dsnopek
enetheru commentedon Mar 17, 2025
The timing of the 4.4-stable tagging and branching was a little unfortunate as the CMake interface needed changing which was merged in #1733 which I am going to petition to have cherry picked for 4.4 branch and have the tag updated asap. I recommend using master at least until #1733 gets cherry picked.
jpxaraujo commentedon Mar 17, 2025
But it still fails in master. You can verify it with my example repo.
enetheru commentedon Mar 17, 2025
Sorry I just woke up, still groggy. I'll test it now.
enetheru commentedon Mar 17, 2025
Try this please:
CMake thinks godot-cpp is your project and will assume you want to know about any warnings raised from includes and such.
Marking godot-cpp as SYSTEM changes the expression of the flags for the compiler so that it wont raise any warnings.
I can do a fresh configure/build with this change, where before it would error due to warnings raised from including godot-cpp headers.
jpxaraujo commentedon Mar 17, 2025
Thank you @enetheru! It works! I didn't know about the SYSTEM thing in CMake. Sorry for the inconvenience.
enetheru commentedon Mar 17, 2025
Not at all, I'm the one making everyone have to adjust, so thank you for working with me.