From bfd8088af5977da91874247ca98d896259b28f3a Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Fri, 9 Apr 2021 16:03:59 +0100 Subject: [PATCH] Allow the backend to be configurable --- CMakeLists.txt | 15 +++++++++++++++ GL/platform.h | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e24d87..ffc6089 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/GL/platform.h b/GL/platform.h index b00072c..b8d4db5 100644 --- a/GL/platform.h +++ b/GL/platform.h @@ -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"