65 lines
1.3 KiB
Plaintext
65 lines
1.3 KiB
Plaintext
#pragma once
|
|
#include "grbc/spec.h"
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
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<std::string> object_files;
|
|
std::vector<std::string> 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<GeneratorCompileCommand> compile_commands;
|
|
std::vector<GeneratorLinkTargetCommand> link_target_commands;
|
|
std::vector<GeneratorExternalTargetCommand> 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(); |