diff options
author | Naios <naios-dev@live.de> | 2016-06-23 22:17:31 +0200 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2016-06-23 22:25:55 +0200 |
commit | 50146b22296aac18f4ee07ed09a8bdc5cf19725c (patch) | |
tree | 9312afc0db67bc2346014eb2f496c2ff184e378d | |
parent | 185921dc2bee47fb174b5dc1de0e7a3d6c67aa38 (diff) |
Build: Throw a fatal error when the SCRIPTS variable isn't a valid option.
* Catches issues early that are caused through a wrong configuration.
(cherry picked from commit 2b97b32d810d105070124b1008723c756589c719)
-rw-r--r-- | cmake/options.cmake | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/cmake/options.cmake b/cmake/options.cmake index 085a45fa03f..94d96305984 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -9,8 +9,20 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. option(SERVERS "Build worldserver and authserver" 1) + +set(SCRIPTS_AVAILABLE_OPTIONS none static dynamic minimal-static minimal-dynamic) + +# Log a fatal 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}") + endif() +endif() + set(SCRIPTS "static" CACHE STRING "Build core with scripts") -set_property(CACHE SCRIPTS PROPERTY STRINGS none static dynamic minimal-static minimal-dynamic) +set_property(CACHE SCRIPTS PROPERTY STRINGS ${SCRIPTS_AVAILABLE_OPTIONS}) # Build a list of all script modules when -DSCRIPT="custom" is selected GetScriptModuleList(SCRIPT_MODULE_LIST) |