[nostalgia/studio] Move BuiltinModules to a cpp file
This commit is contained in:
parent
db3f29d52f
commit
be7b32906f
@ -3,6 +3,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|||||||
add_executable(
|
add_executable(
|
||||||
nostalgia-studio MACOSX_BUNDLE
|
nostalgia-studio MACOSX_BUNDLE
|
||||||
aboutpopup.cpp
|
aboutpopup.cpp
|
||||||
|
builtinmodules.cpp
|
||||||
clawviewer.cpp
|
clawviewer.cpp
|
||||||
filedialogmanager.cpp
|
filedialogmanager.cpp
|
||||||
main.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)
|
set_target_properties(nostalgia-studio PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(
|
|
||||||
FILES
|
|
||||||
nostalgia-studio.json
|
|
||||||
DESTINATION
|
|
||||||
${NOSTALGIA_DIST_RESOURCES}
|
|
||||||
)
|
|
||||||
|
|
||||||
install(
|
install(
|
||||||
FILES
|
FILES
|
||||||
ns_logo128.png
|
ns_logo128.png
|
||||||
|
22
src/nostalgia/studio/builtinmodules.cpp
Normal file
22
src/nostalgia/studio/builtinmodules.cpp
Normal 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());
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -4,21 +4,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <ox/std/memory.hpp>
|
#include "lib/module.hpp"
|
||||||
|
|
||||||
#include <nostalgia/core/studio/module.hpp>
|
#include <ox/std/memory.hpp>
|
||||||
#include <nostalgia/scene/studio/module.hpp>
|
|
||||||
|
|
||||||
namespace nostalgia {
|
namespace nostalgia {
|
||||||
|
|
||||||
[[maybe_unused]] // GCC warns about the existence of this "unused" inline list in a header file...
|
extern ox::Vector<std::function<ox::UPtr<studio::Module>()>> BuiltinModules;
|
||||||
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());
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user