diff --git a/unreal_engine/Readme.md b/unreal_engine/Readme.md new file mode 100644 index 0000000..7fc3ca5 --- /dev/null +++ b/unreal_engine/Readme.md @@ -0,0 +1,4 @@ +# Unreal Engine Version Generator + +This generates a variant of gencpp thats compatiable with use as a thirdparty module within a plugin or module of an Unreal Project or the Engine itself. + diff --git a/unreal_engine/components/header_start.hpp b/unreal_engine/components/header_start.hpp new file mode 100644 index 0000000..e69de29 diff --git a/unreal_engine/components/source_start.cpp b/unreal_engine/components/source_start.cpp new file mode 100644 index 0000000..e69de29 diff --git a/unreal_engine/enums/AttributeTokens.csv b/unreal_engine/enums/AttributeTokens.csv new file mode 100644 index 0000000..b85565b --- /dev/null +++ b/unreal_engine/enums/AttributeTokens.csv @@ -0,0 +1,3 @@ +// TODO(Ed): The Attribute tokens need to be expanded and regenerated on a per-project/installation of this library for a specific codebase of Unreal. +// We can support an arbitrary set of modules or plugin apis for parsing +// but its up to the user to define them all (This will just provide whats be used in previous usages with Unreal). diff --git a/unreal_engine/unreal.cpp b/unreal_engine/unreal.cpp new file mode 100644 index 0000000..198fd56 --- /dev/null +++ b/unreal_engine/unreal.cpp @@ -0,0 +1,60 @@ +#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS +#define GEN_ENFORCE_STRONG_CODE_TYPES +#define GEN_EXPOSE_BACKEDN +#include "gen.cpp" + +#include "helpers/push_ignores.inline.hpp" + +GEN_NS_BEGIN +#include "dependencies/parsing.cpp" +GEN_NS_END + +#include "auxillary/builder.hpp" +#include "auxillary/builder.cpp" +#include "auxillary/scanner.hpp" + +using namespace gen; + +constexpr char const* generation_notice = +"// This file was generated automatially by gencpp's unreal.cpp" +"(See: https://github.com/Ed94/gencpp)\n\n"; + +constexpr StrC implementation_guard_start = txt(R"( +#pragma region GENCPP IMPLEMENTATION GUARD +#if defined(GEN_IMPLEMENTATION) && ! defined(GEN_IMPLEMENTED) +# define GEN_IMPLEMENTED +)"); + +constexpr StrC implementation_guard_end = txt(R"( +#endif +#pragma endregion GENCPP IMPLEMENTATION GUARD +)"); + +constexpr StrC roll_own_dependencies_guard_start = txt(R"( +//! If its desired to roll your own dependencies, define GEN_ROLL_OWN_DEPENDENCIES before including this file. +// Dependencies are derived from the c-zpl library: https://github.com/zpl-c/zpl +#ifndef GEN_ROLL_OWN_DEPENDENCIES + +)"); + +constexpr StrC roll_own_dependencies_guard_end = txt(R"( +// GEN_ROLL_OWN_DEPENDENCIES +#endif +)"); + +global bool generate_gen_dep = true; +global bool generate_builder = true; +global bool generate_editor = true; +global bool generate_scanner = true; + +int gen_main() +{ +#define project_dir "../project/" + gen::init(); + + Code push_ignores = scan_file( project_dir "helpers/push_ignores.inline.hpp" ); + Code pop_ignores = scan_file( project_dir "helpers/pop_ignores.inline.hpp" ); + + Code ue_forceinline = code_str(FORCEINLINE); + // Code +}