Skip to content

godot-cpp 4.4 stable is broken using cmake and ninja #1727

Closed

Description

@CycloneRing

Godot version

4.4.stable

godot-cpp version

4.4.stable

System information

Windows 11

Issue description

When generating CMAKE files for Ninja it doesn't build and throws

ninja: no work to do.

This issue did not exist in 4.3...

Steps to reproduce

  1. Clone godot-cpp repository
  2. Open CMake and select godot-cpp directory
  3. Set configure to Ninja and default compilers.
  4. Generate cmake files
  5. Head to output folder and run Ninja

Minimal reproduction project

No Project, Essential Build Faliure

Activity

  1. enetheru commented on Mar 5, 2025

    @enetheru
    Collaborator

    @dsnopek Can this be closed as a duplicate of #1724 please

    @CycloneRing you'll need to specify a build target atm, probably upload a PR shortly with a fix. In the meantime try --target godot-cpp.template_debug

  2. dsnopek commented on Mar 5, 2025

    @dsnopek
    Collaborator

    Closing as duplicate of #1724

  3. CycloneRing commented on Mar 6, 2025

    @CycloneRing
    Author

    @dsnopek Can this be closed as a duplicate of #1724 please

    @CycloneRing you'll need to specify a build target atm, probably upload a PR shortly with a fix. In the meantime try --target godot-cpp.template_debug

    @enetheru @dsnopek Where should I pass this argument? to Ninja or CMake? None of both seems to accept it.

    CMake Error: Unknown argument --target
    CMake Error: Run 'cmake --help' for all supported options.
    
  4. enetheru commented on Mar 6, 2025

    @enetheru
    Collaborator

    cmake --build <location of build dir> --target godot-cpp.template_debug

  5. CycloneRing commented on Mar 6, 2025

    @CycloneRing
    Author

    cmake --build <location of build dir> --target godot-cpp.template_debug

    This breaks compatibility with our ninja commands, we use automated build system. There's now way to make it work directly by Ninja and not Ninja through CMake --build?

  6. enetheru commented on Mar 6, 2025

    @enetheru
    Collaborator

    i've never run ninja directly before, so i looked into it. cwd is the cmake build dir.

    ninja --help shows a bunch of options, looks like the -t for tool has a list option.
    ninja -t list shows that there is a targets option
    ninja -t targets shows me all the targets
    ninja godot-cpp.template_debug will build the target.

  7. enetheru commented on Mar 6, 2025

    @enetheru
    Collaborator

    curious, how is it automated, what do you need as the outcome?
    The default build type for cmake is Debug, which will add debug symbols to a build, so if you want release versions you need to specify it on the commands to configure and build and that varies on your compiler toolchain. So if you dont mind me asking, what are the compiler toolchains that you have in the automated setup?

  8. CycloneRing commented on Mar 6, 2025

    @CycloneRing
    Author

    i've never run ninja directly before, so i looked into it. cwd is the cmake build dir.

    ninja --help shows a bunch of options, looks like the -t for tool has a list option. ninja -t list shows that there is a targets option ninja -t targets shows me all the targets ninja godot-cpp.template_debug will build the target.

    Hey thanks for the helps, We combined godot-cpp 4.3 and 4.4 and made it work in build system.

    curious, how is it automated, what do you need as the outcome?
    The default build type for cmake is Debug, which will add debug symbols to a build, so if you want release versions you need to specify it on the commands to configure and build and that varies on your compiler toolchain. So if you dont mind me asking, what are the compiler toolchains that you have in the automated setup?

    There are 10 different toolchains and they also expect a output like godot-cpp.windows.minsizerel.64 but now there's libgodot-cpp.windows.editor.x86_64 and it must be renamed everywhere and post process tools must be recompiled.
    Also we use C++ 20 to build godot-cpp and now it's forced to use C++ 17 beside this 4.3 godot-cpp lib was around 60MB and now it's 140MB

    I hope there will be no major changes like this in future, It takes some time for us to adapt all the changes.

  9. enetheru commented on Mar 6, 2025

    @enetheru
    Collaborator

    Be aware that godot-cpp isnt synchronised to godot for versioning, it lags behind somewhat, we are still working on 4.4 and I am hoping to make more changes to the cmake solution before we're done, but not much more.

    I have changed a lot, and i'm sorry for the disruption.

    To speed things up, do you use the build profile option?
    the size increase is probably due to Debug vs Release, so look into changing the configure command. And make sure that your build command for multi-config generators is correct.

  10. CycloneRing commented on Mar 6, 2025

    @CycloneRing
    Author

    To speed things up, do you use the build profile option?
    Yes. I think it must be from LTO.

    For now we use the combined 4.4 and 4.3 CMake and wait for your changes to be finalized :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions