From c8d50b4bddcf5191c0cf567c6ad4a2aee668b2f2 Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Tue, 10 Dec 2024 13:57:34 +0900 Subject: [PATCH] just use the string --- .../src/sofa/helper/system/PluginManager.cpp | 50 ++----------------- 1 file changed, 4 insertions(+), 46 deletions(-) diff --git a/Sofa/framework/Helper/src/sofa/helper/system/PluginManager.cpp b/Sofa/framework/Helper/src/sofa/helper/system/PluginManager.cpp index 3d65ec106b2..2c60200c2bc 100644 --- a/Sofa/framework/Helper/src/sofa/helper/system/PluginManager.cpp +++ b/Sofa/framework/Helper/src/sofa/helper/system/PluginManager.cpp @@ -43,56 +43,14 @@ using sofa::helper::system::FileSystem; #ifdef SOFA_BUILD_CONFIGURATION constexpr std::string_view SOFA_BUILD_CONFIGURATION_STR = sofa_tostring(SOFA_BUILD_CONFIGURATION); #else -constexpr string_view SOFA_BUILD_CONFIGURATION_STR = "NONE"; +constexpr std::string_view SOFA_BUILD_CONFIGURATION_STR = "NONE"; #endif -#ifdef SOFA_BUILD_MULTI_CONFIGURATION -constexpr std::string_view SOFA_BUILD_MULTI_CONFIGURATION_STR = sofa_tostring(SOFA_BUILD_MULTI_CONFIGURATION); -#else -constexpr string_view SOFA_BUILD_MULTI_CONFIGURATION_STR = "0"; -#endif - -enum class SofaBuildConfiguration -{ - Release, - RelWithDebInfo, - Debug, - MinSizeRel, - NonStandard -}; - -constexpr SofaBuildConfiguration getSofaBuildConfiguration() -{ - if constexpr (SOFA_BUILD_CONFIGURATION_STR == "Release") - { - return SofaBuildConfiguration::Release; - } - if constexpr (SOFA_BUILD_CONFIGURATION_STR == "RelWithDebInfo") - { - return SofaBuildConfiguration::RelWithDebInfo; - } - if constexpr (SOFA_BUILD_CONFIGURATION_STR == "Debug") - { - return SofaBuildConfiguration::Debug; - } - if constexpr (SOFA_BUILD_CONFIGURATION_STR == "MinSizeRel") - { - return SofaBuildConfiguration::MinSizeRel; - } - return SofaBuildConfiguration::NonStandard; -} - -constexpr bool getSofaMultiConfiguration() +constexpr std::string_view GetSofaBuildConfigurationString() { - if constexpr (SOFA_BUILD_MULTI_CONFIGURATION_STR == "1") - { - return true; - } - - return false; + return SOFA_BUILD_CONFIGURATION_STR; } - namespace sofa::helper::system { @@ -533,7 +491,7 @@ std::string PluginManager::findPlugin(const std::string& pluginName, const std:: const std::array paths = { dir, // Non-Multi-Config build, install - FileSystem::append(dir, SOFA_BUILD_CONFIGURATION_STR) // Multi-Config build + FileSystem::append(dir, GetSofaBuildConfigurationString()) // Multi-Config build }; for (const auto & path : paths)