Add option to allow custom levels when the editor is disabled

This commit is contained in:
Matt Penny
2020-02-09 21:21:19 -05:00
committed by Ethan Lee
parent 7d35c5ce4e
commit 1b00d12600
10 changed files with 59 additions and 27 deletions

View File

@@ -7,6 +7,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
OPTION(ENABLE_WARNINGS "Enable compilation warnings" ON)
OPTION(ENABLE_WERROR "Treat compilation warnings as errors" OFF)
SET(CUSTOM_LEVEL_SUPPORT ENABLED CACHE STRING "Optionally disable playing and/or editing of custom levels")
SET_PROPERTY(CACHE CUSTOM_LEVEL_SUPPORT PROPERTY STRINGS ENABLED NO_EDITOR DISABLED)
# Architecture Flags
IF(APPLE)
# Wow, Apple is a huge jerk these days huh?
@@ -24,7 +27,6 @@ IF(APPLE)
ENDIF()
PROJECT(VVVVVV)
OPTION(NO_EDITOR "Compile without the level editor" OFF)
IF(APPLE)
MESSAGE(STATUS "Using macOS SDK at ${CMAKE_OSX_SYSROOT}")
@@ -96,10 +98,8 @@ SET(VVV_SRC
src/SteamNetwork.c
src/GOGNetwork.c
)
IF (NOT NO_EDITOR)
IF(NOT CUSTOM_LEVEL_SUPPORT STREQUAL "DISABLED")
LIST(APPEND VVV_SRC src/editor.cpp)
ELSE()
ADD_DEFINITIONS(-DNO_EDITOR)
ENDIF()
SET(XML_SRC
@@ -144,6 +144,12 @@ IF(ENABLE_WARNINGS)
/W4 $<$<BOOL:${ENABLE_WERROR}>:/WX>>)
ENDIF()
IF(CUSTOM_LEVEL_SUPPORT STREQUAL "NO_EDITOR")
ADD_DEFINITIONS(-DNO_EDITOR)
ELSEIF(CUSTOM_LEVEL_SUPPORT STREQUAL "DISABLED")
ADD_DEFINITIONS(-DNO_CUSTOM_LEVELS -DNO_EDITOR)
ENDIF()
# Library information
ADD_LIBRARY(tinyxml-static STATIC ${XML_SRC})
ADD_LIBRARY(physfs-static STATIC ${PFS_SRC} ${PFSP_SRC})