Improved compile time significantly
This commit is contained in:
@ -117,15 +117,15 @@ function(tool_scenecomponent clazz hfile)
|
||||
)
|
||||
if(NOT TARGET sceneitemcomponentgen_cmd)
|
||||
add_custom_target(sceneitemcomponentgen_cmd
|
||||
COMMAND sceneitemcomponentgen --input="${DAWN_TEMP_DIR}/SceneItemComponents.txt" --output="${DAWN_GENERATED_DIR}/scene/SceneItemComponentListItems.hpp"
|
||||
COMMAND sceneitemcomponentgen --input="${DAWN_TEMP_DIR}/SceneItemComponents.txt" --output="${DAWN_GENERATED_DIR}/scene/SceneItemComponentListItems.cpp"
|
||||
COMMENT "Generating scene item component ${hfile}::${clazz}"
|
||||
DEPENDS sceneitemcomponentgen
|
||||
)
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
${DAWN_GENERATED_DIR}/scene/SceneItemComponentListItems.cpp
|
||||
)
|
||||
endif()
|
||||
target_include_directories(${DAWN_TARGET_NAME}
|
||||
PUBLIC
|
||||
${DAWN_GENERATED_DIR}
|
||||
)
|
||||
add_dependencies(sceneitemcomponentgen ${clazz}_scenecomponent)
|
||||
add_dependencies(${DAWN_TARGET_NAME} sceneitemcomponentgen_cmd)
|
||||
endfunction()
|
||||
|
@ -14,21 +14,27 @@ void SceneItemComponentRootGen::generate(
|
||||
std::vector<struct SceneItemComponent> *info,
|
||||
std::string tabs = ""
|
||||
) {
|
||||
struct ClassGenInfo clazz;
|
||||
clazz.clazz = "SceneItemComponentListItems";
|
||||
clazz.extend = "SceneItemComponentList";
|
||||
clazz.includes.push_back("#include \"scene/SceneItemComponentList.hpp\"");
|
||||
|
||||
line(out, "#include \"scene/SceneItemComponentList.hpp\"", tabs);
|
||||
line(out, "", tabs);
|
||||
|
||||
auto it = info->begin();
|
||||
while(it != info->end()) {
|
||||
auto c = *it;
|
||||
clazz.includes.push_back("#include \"" + c.header + "\"");
|
||||
line(&clazz.constructorCode, "this->append<" + c.clazz + ">();", "");
|
||||
line(out, "#include \"" + c.header + "\"", tabs);
|
||||
++it;
|
||||
}
|
||||
line(out, "", tabs);
|
||||
line(out, "using namespace Dawn;", tabs);
|
||||
line(out, "", tabs);
|
||||
|
||||
classGen(out, clazz);
|
||||
line(out, "SceneItemComponentList::SceneItemComponentList() {", tabs);
|
||||
it = info->begin();
|
||||
while(it != info->end()) {
|
||||
auto c = *it;
|
||||
line(out, "this->append<" + c.clazz + ">();", tabs + " ");
|
||||
++it;
|
||||
}
|
||||
line(out, "}", tabs);
|
||||
}
|
||||
|
||||
std::vector<std::string> SceneItemComponentRegister::getRequiredFlags() {
|
||||
|
Reference in New Issue
Block a user