Add official, M&P, no custom levels, and no editor builds to CI

CI builds were added to this repository on the first day it was
released, and haven't really been touched since then. And since then,
2.3 has added NO_CUSTOM_LEVELS, NO_EDITOR, and OFFICIAL_BUILD builds to
the CMake file.

On top of the MAKEANDPLAY define already existing, this means CI
coverage is a bit sparse - covering compile failures for changes made to
most of the codebase, except for Steam and GOG, and not covering compile
failures if certain parts of the code get stripped out. And people do
forget to check for those configurations as well.

These mess of configurations is kind of a wake-up call to refactor and
generalize the code a bit, because we would probably be able to get rid
of at least two of these (Make & Play, and no-custom-levels) by making
it so custom levels behave indistinguishably from the main game. But,
that's something to do in 2.4. At the very least, we should cover these
in CI right now.

On a small note, I had to add a MAKEANDPLAY configure option to the
CMake file to be able to easily configure a Make & Play build from the
CI runner. This option shouldn't really be used otherwise, so I added a
note to it telling people to consider modifying MakeAndPlay.h instead.
This commit is contained in:
Misa
2020-12-26 23:40:28 -08:00
committed by Ethan Lee
parent 3eb3c30817
commit 054c24a7c2
2 changed files with 76 additions and 5 deletions

View File

@@ -15,11 +15,17 @@ SET(GOG OFF CACHE BOOL "Use the GOG API")
SET(OFFICIAL_BUILD OFF CACHE BOOL "Compile an official build of the game")
IF(OFFICIAL_BUILD)
SET(MAKEANDPLAY OFF CACHE BOOL "Compile a version of the game without the main campaign (provided for convenience; consider modifying MakeAndPlay.h instead")
IF(OFFICIAL_BUILD AND NOT MAKEANDPLAY)
SET(STEAM ON)
SET(GOG ON)
ENDIF()
IF(MAKEANDPLAY)
ADD_DEFINITIONS(-DMAKEANDPLAY)
ENDIF()
# Set standard to C++98/C++03
SET(CMAKE_CXX_STANDARD 98)
SET(CMAKE_CXX_EXTENSIONS OFF) # prevent mixing stdlib implementations (dangerous!)