diff --git a/cmake/modules/BaseConfig.cmake b/cmake/modules/BaseConfig.cmake index f987020db26..bbce797ded9 100644 --- a/cmake/modules/BaseConfig.cmake +++ b/cmake/modules/BaseConfig.cmake @@ -136,8 +136,19 @@ endif() # === IPO Configuration === function(configure_linking target_name) if(OPTIONS_ENABLE_IPO) + # Check if IPO/LTO is supported include(CheckIPOSupported) check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output LANGUAGES CXX) + + # Get the GCC compiler version, if applicable + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + execute_process( + COMMAND ${CMAKE_CXX_COMPILER} -dumpversion + OUTPUT_VARIABLE GCC_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + endif() + if(ipo_supported) set_property(TARGET ${target_name} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) message(STATUS "IPO/LTO enabled for target ${target_name}.") @@ -146,8 +157,17 @@ function(configure_linking target_name) target_compile_options(${target_name} PRIVATE /GL) target_link_options(${target_name} PRIVATE /LTCG) elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") - target_compile_options(${target_name} PRIVATE -flto) - target_link_options(${target_name} PRIVATE -flto) + # Check if it's running on Linux, using GCC 14, and in Debug mode + if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND + CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND + GCC_VERSION VERSION_GREATER_EQUAL "14" AND + GCC_VERSION VERSION_LESS "15" AND + CMAKE_BUILD_TYPE STREQUAL "Debug") + message(WARNING "LTO disabled for GCC 14 in Debug mode on Linux for target ${target_name}.") + else() + target_compile_options(${target_name} PRIVATE -flto) + target_link_options(${target_name} PRIVATE -flto) + endif() endif() else() message(WARNING "IPO/LTO is not supported for target ${target_name}: ${ipo_output}") diff --git a/src/lua/functions/core/game/lua_enums.cpp b/src/lua/functions/core/game/lua_enums.cpp index 22b93351911..a0870052f87 100644 --- a/src/lua/functions/core/game/lua_enums.cpp +++ b/src/lua/functions/core/game/lua_enums.cpp @@ -19,6 +19,8 @@ #include "enums/account_type.hpp" #include "enums/account_group_type.hpp" +constexpr const char* soundNamespace = "SOUND_EFFECT_TYPE_"; + #define registerMagicEnum(luaState, enumClassType) \ { \ auto number = magic_enum::enum_integer(enumClassType); \ @@ -107,6 +109,9 @@ void LuaEnums::init(lua_State* L) { initWebhookEnums(L); initBosstiaryEnums(L); initSoundEnums(L); + spelltSoundEnums(L); + monsterSoundEnums(L); + effectsSoundEnums(L); initWheelEnums(L); initAttributeConditionSubIdEnums(L); initConcoctionsEnum(L); @@ -1242,7 +1247,6 @@ void LuaEnums::initBosstiaryEnums(lua_State* L) { // "SOUND_EFFECT_TYPE_" is the sound lua namespace void LuaEnums::initSoundEnums(lua_State* L) { - std::string soundNamespace = "SOUND_EFFECT_TYPE_"; registerEnumNamespace(L, soundNamespace, SoundEffect_t::SILENCE); registerEnumNamespace(L, soundNamespace, SoundEffect_t::HUMAN_CLOSE_ATK_FIST); registerEnumNamespace(L, soundNamespace, SoundEffect_t::MONSTER_CLOSE_ATK_FIST); @@ -1272,6 +1276,9 @@ void LuaEnums::initSoundEnums(lua_State* L) { registerEnumNamespace(L, soundNamespace, SoundEffect_t::MONSTER_MELEE_ATK_MAGIC); registerEnumNamespace(L, soundNamespace, SoundEffect_t::MONSTER_MELEE_ATK_ETHEREAL); registerEnumNamespace(L, soundNamespace, SoundEffect_t::MONSTER_MELEE_ATK_CONSTRUCT); +} + +void LuaEnums::spelltSoundEnums(lua_State* L) { registerEnumNamespace(L, soundNamespace, SoundEffect_t::SPELL_LIGHT_HEALING); registerEnumNamespace(L, soundNamespace, SoundEffect_t::SPELL_INTENSE_HEALING); registerEnumNamespace(L, soundNamespace, SoundEffect_t::SPELL_ULTIMATE_HEALING); @@ -1423,6 +1430,9 @@ void LuaEnums::initSoundEnums(lua_State* L) { registerEnumNamespace(L, soundNamespace, SoundEffect_t::SPELL_EXPOSE_WEAKNESS); registerEnumNamespace(L, soundNamespace, SoundEffect_t::SPELL_SAP_STRENGTH); registerEnumNamespace(L, soundNamespace, SoundEffect_t::SPELL_CANCEL_MAGIC_SHIELD); +} + +void LuaEnums::monsterSoundEnums(lua_State* L) { registerEnumNamespace(L, soundNamespace, SoundEffect_t::MONSTER_SPELL_SINGLE_TARGET_FIRE); registerEnumNamespace(L, soundNamespace, SoundEffect_t::MONSTER_SPELL_SINGLE_TARGET_ENERGY); registerEnumNamespace(L, soundNamespace, SoundEffect_t::MONSTER_SPELL_SINGLE_TARGET_EARTH); @@ -1487,6 +1497,9 @@ void LuaEnums::initSoundEnums(lua_State* L) { registerEnumNamespace(L, soundNamespace, SoundEffect_t::MONSTER_SPELL_HIGHRISK_TELEPORT); registerEnumNamespace(L, soundNamespace, SoundEffect_t::MONSTER_SPELL_MINION); registerEnumNamespace(L, soundNamespace, SoundEffect_t::MONSTER_SPELL_AGONY); +} + +void LuaEnums::effectsSoundEnums(lua_State* L) { registerEnumNamespace(L, soundNamespace, SoundEffect_t::AMPHIBIC_BARK); registerEnumNamespace(L, soundNamespace, SoundEffect_t::AQUATIC_BEAST_BARK); registerEnumNamespace(L, soundNamespace, SoundEffect_t::AQUATIC_CRITTER_BARK); diff --git a/src/lua/functions/core/game/lua_enums.hpp b/src/lua/functions/core/game/lua_enums.hpp index 8beabbbacee..d14ca0ceb54 100644 --- a/src/lua/functions/core/game/lua_enums.hpp +++ b/src/lua/functions/core/game/lua_enums.hpp @@ -66,5 +66,8 @@ class LuaEnums final : LuaScriptInterface { static void initWebhookEnums(lua_State* L); static void initBosstiaryEnums(lua_State* L); static void initSoundEnums(lua_State* L); + static void spelltSoundEnums(lua_State* L); + static void monsterSoundEnums(lua_State* L); + static void effectsSoundEnums(lua_State* L); static void initWheelEnums(lua_State* L); };