[olympic/applib] Change applib run arguments
This commit is contained in:
parent
6dec1bf5ed
commit
e3b2c66d70
@ -9,6 +9,10 @@
|
|||||||
#define OLYMPIC_PROJECT_NAME "OlympicProject"
|
#define OLYMPIC_PROJECT_NAME "OlympicProject"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef OLYMPIC_APP_NAME
|
||||||
|
#define OLYMPIC_APP_NAME "App"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef OLYMPIC_PROJECT_NAMESPACE
|
#ifndef OLYMPIC_PROJECT_NAMESPACE
|
||||||
#define OLYMPIC_PROJECT_NAMESPACE project
|
#define OLYMPIC_PROJECT_NAMESPACE project
|
||||||
#endif
|
#endif
|
||||||
@ -27,10 +31,8 @@
|
|||||||
|
|
||||||
namespace olympic {
|
namespace olympic {
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
ox::StringView appName() noexcept;
|
|
||||||
|
|
||||||
ox::Error run(
|
ox::Error run(
|
||||||
|
ox::StringView project,
|
||||||
ox::StringView appName,
|
ox::StringView appName,
|
||||||
ox::StringView projectDataDir,
|
ox::StringView projectDataDir,
|
||||||
int argc,
|
int argc,
|
||||||
@ -50,14 +52,14 @@ int WinMain() {
|
|||||||
#else
|
#else
|
||||||
int main(int argc, const char **argv) {
|
int main(int argc, const char **argv) {
|
||||||
#endif
|
#endif
|
||||||
OX_INIT_DEBUG_LOGGER(loggerConn, olympic::appName())
|
OX_INIT_DEBUG_LOGGER(loggerConn, OLYMPIC_PROJECT_NAME " " OLYMPIC_APP_NAME)
|
||||||
#if OLYMPIC_LOAD_KEEL_MODULES
|
#if OLYMPIC_LOAD_KEEL_MODULES
|
||||||
OLYMPIC_PROJECT_NAMESPACE::registerKeelModules();
|
OLYMPIC_PROJECT_NAMESPACE::registerKeelModules();
|
||||||
#endif
|
#endif
|
||||||
#if OLYMPIC_LOAD_STUDIO_MODULES
|
#if OLYMPIC_LOAD_STUDIO_MODULES
|
||||||
OLYMPIC_PROJECT_NAMESPACE::registerStudioModules();
|
OLYMPIC_PROJECT_NAMESPACE::registerStudioModules();
|
||||||
#endif
|
#endif
|
||||||
auto const err = olympic::run(olympic::appName(), OLYMPIC_PROJECT_DATADIR, argc, argv);
|
auto const err = olympic::run(OLYMPIC_PROJECT_NAME, OLYMPIC_APP_NAME, OLYMPIC_PROJECT_DATADIR, argc, argv);
|
||||||
oxAssert(err, "Something went wrong...");
|
oxAssert(err, "Something went wrong...");
|
||||||
if (err) {
|
if (err) {
|
||||||
oxErrf("Failure: {}\n", toStr(err));
|
oxErrf("Failure: {}\n", toStr(err));
|
||||||
|
@ -12,17 +12,4 @@ namespace studio {
|
|||||||
|
|
||||||
void registerModule(const studio::Module*) noexcept;
|
void registerModule(const studio::Module*) noexcept;
|
||||||
|
|
||||||
struct StudioOptions {
|
|
||||||
ox::String appName;
|
|
||||||
ox::String projectDataDir;
|
|
||||||
};
|
|
||||||
|
|
||||||
ox::Error run(StudioOptions&&);
|
|
||||||
|
|
||||||
ox::Error run(
|
|
||||||
ox::CRStringView appName,
|
|
||||||
ox::CRStringView projectDataDir,
|
|
||||||
int argc,
|
|
||||||
const char **argv);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ add_library(
|
|||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
StudioAppLib PUBLIC
|
StudioAppLib PUBLIC
|
||||||
OLYMPIC_LOAD_STUDIO_MODULES=1
|
OLYMPIC_LOAD_STUDIO_MODULES=1
|
||||||
|
OLYMPIC_APP_NAME="Studio"
|
||||||
)
|
)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
StudioAppLib PUBLIC
|
StudioAppLib PUBLIC
|
||||||
|
@ -80,6 +80,11 @@ ox::Error run(
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct StudioOptions {
|
||||||
|
ox::String appName;
|
||||||
|
ox::String projectDataDir;
|
||||||
|
};
|
||||||
|
|
||||||
ox::Error run(StudioOptions &&opts, int argc = 0, const char **argv = nullptr) {
|
ox::Error run(StudioOptions &&opts, int argc = 0, const char **argv = nullptr) {
|
||||||
return run(opts.appName, opts.projectDataDir, argc, argv);
|
return run(opts.appName, opts.projectDataDir, argc, argv);
|
||||||
}
|
}
|
||||||
@ -88,17 +93,13 @@ ox::Error run(StudioOptions &&opts, int argc = 0, const char **argv = nullptr) {
|
|||||||
|
|
||||||
namespace olympic {
|
namespace olympic {
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
ox::StringView appName() noexcept {
|
|
||||||
return "Nostalgia Studio";
|
|
||||||
}
|
|
||||||
|
|
||||||
ox::Error run(
|
ox::Error run(
|
||||||
|
ox::StringView project,
|
||||||
ox::StringView appName,
|
ox::StringView appName,
|
||||||
ox::StringView projectDataDir,
|
ox::StringView projectDataDir,
|
||||||
int argc,
|
int argc,
|
||||||
const char **argv) noexcept {
|
const char **argv) noexcept {
|
||||||
return studio::run(appName, projectDataDir, argc, argv);
|
return studio::run(ox::sfmt("{} {}", project, appName), projectDataDir, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user