Allow the backend to be configurable

This commit is contained in:
Luke Benstead 2021-04-09 16:03:59 +01:00
parent 6efb90f28c
commit bfd8088af5
2 changed files with 16 additions and 1 deletions

View File

@ -1,6 +1,21 @@
cmake_minimum_required(VERSION 3.0)
project(GLdc)
# set the default backend
if(PLATFORM_DREAMCAST)
set(BACKEND "kospvr" CACHE STRING "Backend to use")
else()
set(BACKEND "software" CACHE STRING "Backend to use")
endif()
# List of possible backends
set_property(CACHE BACKEND PROPERTY STRINGS kospvr software)
message("\nCompiling using backend: ${BACKEND}\n")
string(TOUPPER ${BACKEND} BACKEND_UPPER)
add_definitions(-DBACKEND_${BACKEND_UPPER})
set(CMAKE_C_STANDARD 99)
include_directories(include)

View File

@ -491,7 +491,7 @@ static inline void CompilePolyHeader(PolyHeader *dst, const PolyContext *src) {
dst->d3 = dst->d4 = 0xffffffff;
}
#ifdef __DREAMCAST__
#ifdef BACKEND_KOSPVR
#include "platforms/sh4.h"
#else
#include "platforms/software.h"