godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

Ensure each header can be compiled on its own + reduced header dependencies

Open RiederAlex opened this issue 3 years ago • 1 comments

This makes sure an empty .cpp file with only the header as an include compiles correctly. Additionally it removes/updates/improves some includes.

e.g. previously this would not compile:

#include <godot_cpp/classes/object.hpp>
#include <godot_cpp/classes/wrapped.hpp>

class MyClass: public godot::Object
{
  GDCLASS(MyClass, Object);
//...

as wrapped.hpp (or, more specifically, the expanded GDCLASS macro) requires a declaration of ClassDB.

Now the user of the library should be able to look up where a symbol is declared, include the header and use it.

RiederAlex avatar Aug 09 '22 22:08 RiederAlex

If this is still desired, this needs a rebase. Also, we must ensure that these files stay in sync with their equivalents on the engine side, so please check if any of these changes should be applied to the engine first.

aaronfranke avatar Jul 08 '23 17:07 aaronfranke