mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-02 08:49:20 -05:00
Update codegen, make use of source location information
This commit is contained in:
+2
-1
@@ -163,7 +163,8 @@ add_custom_target(
|
||||
add_dependencies(run_codegen codegen)
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/__codegen.h"
|
||||
COMMAND codegen ARGS "${PROJECT_SOURCE_DIR}/modules" "${PROJECT_SOURCE_DIR}/src"
|
||||
COMMAND codegen ARGS "modules" "src"
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||
VERBATIM
|
||||
)
|
||||
set_target_properties(codegen-lib PROPERTIES FOLDER "support")
|
||||
|
||||
@@ -61,6 +61,11 @@ struct LuaLibrary {
|
||||
std::string returnType;
|
||||
/// A help text describing what the function does/
|
||||
std::string helpText;
|
||||
/// The source location where the implementation for this Lua file is located
|
||||
struct {
|
||||
std::string file = "<none>";
|
||||
int line = 0;
|
||||
} sourceLocation;
|
||||
};
|
||||
/// The name of the library
|
||||
std::string name;
|
||||
|
||||
@@ -113,7 +113,11 @@ namespace {
|
||||
}
|
||||
json << "],";
|
||||
json << fmt::format(replStr, "returnType", escapedJson(f.returnType));
|
||||
json << fmt::format(replStr2, "help", escapedJson(f.helpText));
|
||||
json << fmt::format(replStr, "help", escapedJson(f.helpText));
|
||||
json << fmt::format(
|
||||
"\"sourceLocation\": {{ \"file\": {}, \"line\": {} }}",
|
||||
escapedJson(f.sourceLocation.file), f.sourceLocation.line
|
||||
);
|
||||
json << "}";
|
||||
if (&f != &library.functions.back() || !library.documentations.empty()) {
|
||||
json << ",";
|
||||
|
||||
+1
-1
Submodule support/coding/codegen updated: 1aa8bf72c7...3ceac9b873
Reference in New Issue
Block a user