[olympic/applib] Make applib module loading optional

This commit is contained in:
Gary Talent 2023-12-10 20:59:15 -06:00
parent 393259a010
commit 6a1e2f7566
2 changed files with 16 additions and 1 deletions

View File

@ -17,6 +17,14 @@
#define OLYMPIC_PROJECT_DATADIR ".keel"
#endif
#ifndef OLYMPIC_LOAD_KEEL_MODULES
#define OLYMPIC_LOAD_KEEL_MODULES 1
#endif
#ifndef OLYMPIC_LOAD_STUDIO_MODULES
#define OLYMPIC_LOAD_STUDIO_MODULES 0
#endif
ox::Error run(
ox::StringView appName,
ox::StringView projectDataDir,
@ -41,8 +49,12 @@ int WinMain() {
int main(int argc, const char **argv) {
#endif
OX_INIT_DEBUG_LOGGER(loggerConn, olympic::appName())
#if OLYMPIC_LOAD_KEEL_MODULES
OLYMPIC_PROJECT_NAMESPACE::registerKeelModules();
#endif
#if OLYMPIC_LOAD_STUDIO_MODULES
OLYMPIC_PROJECT_NAMESPACE::registerStudioModules();
#endif
auto const err = run(olympic::appName(), OLYMPIC_PROJECT_DATADIR, argc, argv);
oxAssert(err, "Something went wrong...");
if (err) {

View File

@ -9,7 +9,10 @@ add_library(
projecttreemodel.cpp
studioapp.cpp
)
target_compile_definitions(
StudioAppLib PUBLIC
OLYMPIC_LOAD_STUDIO_MODULES=1
)
target_link_libraries(
StudioAppLib PUBLIC
OxClArgs