diff options
author | Kargatum <dowlandtop@yandex.com> | 2021-06-23 04:19:02 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-22 23:19:02 +0200 |
commit | 5991b2769acc2f7c1959f1850a36a22c968bb45c (patch) | |
tree | 86ffae3a32cf14f00784a8a0c458d1644b438e4b /conf | |
parent | 20a67cbfcf78e830fce746ee1a7ea16db2f4ca80 (diff) |
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
* 039f0e0faa081352d19f34b6f0abaa4e74414988
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
Diffstat (limited to 'conf')
-rw-r--r-- | conf/dist/config.cmake | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/conf/dist/config.cmake b/conf/dist/config.cmake index 22f349f859..f0fc600866 100644 --- a/conf/dist/config.cmake +++ b/conf/dist/config.cmake @@ -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) |