#pragma once #include "grbc/spec.h" #include #include enum GeneratorTargetType { GeneratorTargetType_Executable, GeneratorTargetType_SharedLibrary, GeneratorTargetType_StaticLibrary }; struct GeneratorResult { std::string file_name; std::string content; }; struct GeneratorCompileCommand { LanguageType language_type; std::string source_file; std::string object_file; std::string compiler_flags; }; struct GeneratorLinkTargetCommand { std::vector object_files; std::vector libraries; // Libraries which need to be built before this std::string linker_flags; std::string output_name; GeneratorTargetType target_type; }; struct GeneratorExternalTargetCommand { }; struct GeneratorTarget { std::vector compile_commands; std::vector link_target_commands; std::vector external_target_commands; }; struct GeneratorTask { std::string description, id; std::string shell_script; }; typedef GeneratorResult (*Generator_Run)(); struct Generator { /// Name of the generator, used in grbc_build(...) std::string name; /// Function pointer for this generator Generator_Run func; }; /** * Ninja generator main function */ GeneratorResult ninja_generator();