From 6a1e2f7566b7888361fa66f4510acdf9fd9c029a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 10 Dec 2023 20:59:15 -0600 Subject: [PATCH] [olympic/applib] Make applib module loading optional --- src/olympic/applib/applib.cpp | 12 ++++++++++++ src/studio/applib/src/CMakeLists.txt | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/olympic/applib/applib.cpp b/src/olympic/applib/applib.cpp index 977d80a7..fdca8e77 100644 --- a/src/olympic/applib/applib.cpp +++ b/src/olympic/applib/applib.cpp @@ -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) { diff --git a/src/studio/applib/src/CMakeLists.txt b/src/studio/applib/src/CMakeLists.txt index 419e5d02..b9c1d765 100644 --- a/src/studio/applib/src/CMakeLists.txt +++ b/src/studio/applib/src/CMakeLists.txt @@ -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