[nostalgia/studio] Move BuiltinModules to a cpp file

This commit is contained in:
Gary Talent 2023-06-02 20:14:51 -05:00
parent db3f29d52f
commit be7b32906f
3 changed files with 27 additions and 20 deletions

View File

@ -3,6 +3,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(
nostalgia-studio MACOSX_BUNDLE
aboutpopup.cpp
builtinmodules.cpp
clawviewer.cpp
filedialogmanager.cpp
main.cpp
@ -31,13 +32,6 @@ if(APPLE)
set_target_properties(nostalgia-studio PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
endif()
install(
FILES
nostalgia-studio.json
DESTINATION
${NOSTALGIA_DIST_RESOURCES}
)
install(
FILES
ns_logo128.png

View File

@ -0,0 +1,22 @@
/*
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#include <ox/std/memory.hpp>
#include <nostalgia/core/studio/module.hpp>
#include <nostalgia/scene/studio/module.hpp>
namespace nostalgia {
[[maybe_unused]] // GCC warns about the existence of this "unused" inline list in a header file...
ox::Vector<std::function<ox::UPtr<studio::Module>()>> BuiltinModules = {
[]() -> ox::UPtr<studio::Module> {
return ox::UPtr<studio::Module>(new core::StudioModule());
},
[]() -> ox::UPtr<studio::Module> {
return ox::UPtr<studio::Module>(new scene::StudioModule());
},
};
}

View File

@ -4,21 +4,12 @@
#pragma once
#include <ox/std/memory.hpp>
#include "lib/module.hpp"
#include <nostalgia/core/studio/module.hpp>
#include <nostalgia/scene/studio/module.hpp>
#include <ox/std/memory.hpp>
namespace nostalgia {
[[maybe_unused]] // GCC warns about the existence of this "unused" inline list in a header file...
inline ox::Vector<std::function<ox::UPtr<studio::Module>()>, 2> BuiltinModules = {
[]() -> ox::UPtr<studio::Module> {
return ox::UPtr<studio::Module>(new core::StudioModule());
},
[]() -> ox::UPtr<studio::Module> {
return ox::UPtr<studio::Module>(new scene::StudioModule());
},
};
extern ox::Vector<std::function<ox::UPtr<studio::Module>()>> BuiltinModules;
}
}