[nostalgia] Split part of Core out into Foundation, add module system

This commit is contained in:
2023-02-03 00:41:24 -06:00
parent 83589287bc
commit 7868b0678f
50 changed files with 742 additions and 470 deletions

View File

@@ -0,0 +1,20 @@
add_library(
NostalgiaAppModules OBJECT
appmodules.cpp
)
if(NOT MSVC)
target_compile_options(NostalgiaAppModules PRIVATE -Wsign-conversion)
endif()
target_link_libraries(
NostalgiaAppModules PUBLIC
NostalgiaCore
)
install(
FILES
appmodules.hpp
DESTINATION
include/nostalgia/appmodules
)

View File

@@ -0,0 +1,27 @@
/*
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#include <ox/std/array.hpp>
#include <nostalgia/foundation/module.hpp>
#include <nostalgia/core/module.hpp>
namespace nostalgia {
void loadModules() noexcept {
static bool done = false;
if (done) {
return;
}
const ox::Array<foundation::Module*, 1> mods = {
&core::CoreModule::mod,
};
for (const auto m : mods) {
foundation::registerModule(m);
}
done = true;
}
}

View File

@@ -0,0 +1,11 @@
/*
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#pragma once
namespace nostalgia {
void loadModules() noexcept;
}