aboutsummaryrefslogtreecommitdiff
path: root/cmake/options.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/options.cmake')
-rw-r--r--cmake/options.cmake14
1 files changed, 13 insertions, 1 deletions
diff --git a/cmake/options.cmake b/cmake/options.cmake
index 93e51141207..09efc3db08b 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 bnetserver" 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)