Tuning.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright (c) 2008-2023 the Urho3D project
  2. // License: MIT
  3. // Functions that users can change to affect the work BindingGenerator
  4. #include "XmlSourceData.h"
  5. #include "Tuning.h"
  6. #include "Utils.h"
  7. using namespace std;
  8. // Some parts of the engine are compiled only if there are defines
  9. string InsideDefine(const string& headerFile)
  10. {
  11. string dir = WithoutFileName(headerFile);
  12. if (dir == "../Network")
  13. return "URHO3D_NETWORK";
  14. if (dir == "../Database")
  15. return "URHO3D_DATABASE";
  16. if (dir == "../IK")
  17. return "URHO3D_IK";
  18. if (dir == "../Physics")
  19. return "URHO3D_PHYSICS";
  20. if (dir == "../Physics2D")
  21. return "URHO3D_PHYSICS2D";
  22. if (dir == "../Navigation")
  23. return "URHO3D_NAVIGATION";
  24. if (dir == "../Urho2D")
  25. return "URHO3D_URHO2D";
  26. return string();
  27. }
  28. // Users can prevent the automatic creation of bindings for certain files and dirs
  29. bool IsIgnoredHeader(const string& headerFile)
  30. {
  31. static vector<string> ignoredDirs = {
  32. "../AngelScript",
  33. //"../Container",
  34. "../LuaScript",
  35. "../GraphicsAPI/Direct3D11",
  36. "../GraphicsAPI/Direct3D9",
  37. "../GraphicsAPI/OpenGL",
  38. "../Database/ODBC",
  39. "../Database/SQLite",
  40. };
  41. static vector<string> ignoredHeaders = {
  42. //"../Graphics/Drawable.h",
  43. };
  44. if (CONTAINS(SourceData::ignoredHeaders_, headerFile))
  45. return true;
  46. if (CONTAINS(ignoredHeaders, headerFile))
  47. return true;
  48. string dir = WithoutFileName(headerFile);
  49. if (CONTAINS(ignoredDirs, dir))
  50. return true;
  51. return false;
  52. }