diff --git a/src/app/appfactory.cpp b/src/app/appfactory.cpp index ccc59ecb398fe..47bb300107b03 100644 --- a/src/app/appfactory.cpp +++ b/src/app/appfactory.cpp @@ -234,15 +234,15 @@ std::shared_ptr AppFactory::newGuiApp(const CmdOptions& opti app->addModule(new muse::mpe::MpeModule()); #ifdef MUSE_MODULE_MUSESAMPLER - bool needAdd = true; -#ifndef MUSE_MODULE_MUSESAMPLER_ENABLE_DEBUG + bool shouldAddMuseSamplerModule = true; +#ifndef MUSE_MODULE_MUSESAMPLER_LOAD_IN_DEBUG if (runtime::isDebug()) { - needAdd = false; - LOGI() << "Muse Sampler is not a debuggable binary. Skipping adding."; + shouldAddMuseSamplerModule = false; + LOGI() << "Not adding MuseSampler module in a debug build"; } #endif - if (needAdd) { + if (shouldAddMuseSamplerModule) { app->addModule(new muse::musesampler::MuseSamplerModule()); } #endif diff --git a/src/framework/cmake/MuseDeclareOptions.cmake b/src/framework/cmake/MuseDeclareOptions.cmake index 4dde3fcb40a6e..71e4c1f5e5c7a 100644 --- a/src/framework/cmake/MuseDeclareOptions.cmake +++ b/src/framework/cmake/MuseDeclareOptions.cmake @@ -42,7 +42,7 @@ declare_muse_module_opt(MPE ON) declare_muse_module_opt(MULTIINSTANCES ON) declare_muse_module_opt(MUSESAMPLER ON) -option(MUSE_MODULE_MUSESAMPLER_ENABLE_DEBUG "Enable musesampler debug support" OFF) +option(MUSE_MODULE_MUSESAMPLER_LOAD_IN_DEBUG "Load MuseSampler module in debug builds" OFF) declare_muse_module_opt(NETWORK ON) option(MUSE_MODULE_NETWORK_WEBSOCKET "Enable websocket support" OFF) diff --git a/src/framework/cmake/muse_framework_config.h.in b/src/framework/cmake/muse_framework_config.h.in index 8ea66bfcaf910..c292952b5a7c9 100644 --- a/src/framework/cmake/muse_framework_config.h.in +++ b/src/framework/cmake/muse_framework_config.h.in @@ -96,6 +96,7 @@ #cmakedefine MUSE_MODULE_MUSESAMPLER 1 #cmakedefine MUSE_MODULE_MUSESAMPLER_TESTS 1 #cmakedefine MUSE_MODULE_MUSESAMPLER_API 1 +#cmakedefine MUSE_MODULE_MUSESAMPLER_LOAD_IN_DEBUG 1 #cmakedefine MUSE_MODULE_NETWORK 1 #cmakedefine MUSE_MODULE_NETWORK_TESTS 1 diff --git a/src/framework/musesampler/CMakeLists.txt b/src/framework/musesampler/CMakeLists.txt index 108209e0dae18..568ad4a0c4964 100644 --- a/src/framework/musesampler/CMakeLists.txt +++ b/src/framework/musesampler/CMakeLists.txt @@ -45,8 +45,4 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/internal/musesampleractioncontroller.h ) -if(MUSE_MODULE_MUSESAMPLER_ENABLE_DEBUG) - set(MODULE_DEF -DMUSE_MODULE_MUSESAMPLER_ENABLE_DEBUG) -endif() - setup_module()