initial setup for generating a library compatible for usage as an Unreal thirdyparty module.

This commit is contained in:
Edward R. Gonzalez 2024-10-25 01:04:48 -04:00
parent b8e1aa6eb7
commit 40a256f6c3
5 changed files with 67 additions and 0 deletions

4
unreal_engine/Readme.md Normal file
View File

@ -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.

View File

@ -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).
1 // 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.
2 // We can support an arbitrary set of modules or plugin apis for parsing
3 // but its up to the user to define them all (This will just provide whats be used in previous usages with Unreal).

60
unreal_engine/unreal.cpp Normal file
View File

@ -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
}