mirror of
https://github.com/GayPizzaSpecifications/padlab.git
synced 2025-08-03 21:21:33 +00:00
Split USE backends into separate targets
This commit is contained in:
@ -2,26 +2,9 @@ cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
|
||||
project(padlab C)
|
||||
set(TARGET padlab)
|
||||
|
||||
option(USE_METAL "use Metal for drawing" ${APPLE})
|
||||
if (USE_METAL)
|
||||
option(USE_OPENGL "Use OpenGL for drawing (WIP)" OFF)
|
||||
option(USE_OPENGL_LEGACY "Use legacy OpenGL for drawing" OFF)
|
||||
if (USE_OPENGL)
|
||||
message(FATAL_ERROR "USE_METAL and USE_OPENGL are both ON but only one backend can be used at a time, turn one OFF and regenerate. (or delete cache and try again)")
|
||||
elseif (USE_OPENGL_LEGACY)
|
||||
message(FATAL_ERROR "USE_METAL and USE_OPENGL_LEGACY are both ON but only one backend can be used at a time, turn one OFF and regenerate. (or delete cache and try again)")
|
||||
endif()
|
||||
else()
|
||||
option(USE_OPENGL "Use OpenGL for drawing (WIP)" OFF)
|
||||
if (USE_OPENGL)
|
||||
option(USE_OPENGL_LEGACY "Use legacy OpenGL for drawing" OFF)
|
||||
if (USE_OPENGL_LEGACY)
|
||||
message(FATAL_ERROR "USE_OPENGL and USE_OPENGL_LEGACY are both ON but only one backend can be used at a time, turn one OFF and regenerate. (or delete cache and try again)")
|
||||
endif()
|
||||
else()
|
||||
option(USE_OPENGL_LEGACY "Use legacy OpenGL for drawing" ON)
|
||||
endif()
|
||||
endif()
|
||||
option(BUILD_OPENGL_LEGACY "Build legacy OpenGL 1.1 compatibility profile executable" ON)
|
||||
option(BUILD_METAL "Build executable using Metal for drawing (WIP)" ${APPLE})
|
||||
option(BUILD_OPENGL "Build OpenGL 3.3 core profile executable (WIP)" OFF)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
@ -33,7 +16,7 @@ elseif (MSVC)
|
||||
endif()
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
if (USE_OPENGL OR USE_OPENGL_LEGACY)
|
||||
if (BUILD_OPENGL OR BUILD_OPENGL_LEGACY)
|
||||
if (NOT DEFINED OpenGL_GL_PREFERENCE)
|
||||
set(OpenGL_GL_PREFERENCE "GLVND")
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user