feat(Core/Scripts): split the huge scriptloader into smaller pieces (#5346)

* feat(Core/Scripts): split the huge scriptloader into smaller pieces

* AddSC_swamp_of_sorrows del

* 1

* add mod info

* 1

* 039f0e0faa

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
Kargatum
2021-06-23 04:19:02 +07:00
committed by GitHub
parent 20a67cbfcf
commit 5991b2769a
49 changed files with 1978 additions and 2264 deletions

View File

@@ -1,5 +1,60 @@
#
# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
# Copyright (C) 2021+ WarheadCore <https://github.com/WarheadCore>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
option(SERVERS "Build worldserver and authserver" 1)
option(SCRIPTS "Build core with scripts included" 1)
set(SCRIPTS_AVAILABLE_OPTIONS none static dynamic minimal-static minimal-dynamic)
set(MODULES_AVAILABLE_OPTIONS none static dynamic)
set(SCRIPTS "static" CACHE STRING "Build core with scripts")
set(MODULES "static" CACHE STRING "Build core with modules")
set_property(CACHE SCRIPTS PROPERTY STRINGS ${SCRIPTS_AVAILABLE_OPTIONS})
set_property(CACHE MODULES PROPERTY STRINGS ${MODULES_AVAILABLE_OPTIONS})
# Log a error when the value of the SCRIPTS variable isn't a valid option.
if(SCRIPTS)
list(FIND SCRIPTS_AVAILABLE_OPTIONS "${SCRIPTS}" SCRIPTS_INDEX)
if(${SCRIPTS_INDEX} EQUAL -1)
message(FATAL_ERROR "The value (${SCRIPTS}) of your SCRIPTS variable is invalid! "
"Allowed values are: ${SCRIPTS_AVAILABLE_OPTIONS}. Set static")
endif()
endif()
# Log a error when the value of the SCRIPTS variable isn't a valid option.
if(MODULES)
list(FIND MODULES_AVAILABLE_OPTIONS "${MODULES}" MODULES_INDEX)
if(${MODULES_INDEX} EQUAL -1)
message(FATAL_ERROR "The value (${MODULES}) of your MODULES variable is invalid! "
"Allowed values are: ${MODULES_AVAILABLE_OPTIONS}. Set static")
endif()
endif()
# Build a list of all script modules when -DSCRIPT="custom" is selected
GetScriptModuleList(SCRIPT_MODULE_LIST)
foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE)
set(${SCRIPT_MODULE_VARIABLE} "default" CACHE STRING "Build type of the ${SCRIPT_MODULE} module.")
set_property(CACHE ${SCRIPT_MODULE_VARIABLE} PROPERTY STRINGS default disabled static dynamic)
endforeach()
# Build a list of all modules script when -DSCRIPT="custom" is selected
GetModuleSourceList(SCRIPT_MODULE_LIST)
foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
ModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE)
set(${SCRIPT_MODULE_VARIABLE} "default" CACHE STRING "Build type of the ${SCRIPT_MODULE} module.")
set_property(CACHE ${SCRIPT_MODULE_VARIABLE} PROPERTY STRINGS default disabled static dynamic)
endforeach()
option(BUILD_TESTING "Build unit tests" 0)
option(TOOLS "Build map/vmap/mmap extraction/assembler tools" 0)
option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1)
@@ -16,6 +71,7 @@ option(WITH_DYNAMIC_LINKING "Enable dynamic library linking."
option(WITH_STRICT_DATABASE_TYPE_CHECKS "Enable strict checking of database field value accessors" 0)
IsDynamicLinkingRequired(WITH_DYNAMIC_LINKING_FORCED)
IsDynamicLinkingModulesRequired(WITH_DYNAMIC_LINKING_FORCED)
if(WITH_DYNAMIC_LINKING AND WITH_DYNAMIC_LINKING_FORCED)
set(WITH_DYNAMIC_LINKING_FORCED OFF)