-
Notifications
You must be signed in to change notification settings - Fork 40
/
CMakeLists.txt
38 lines (31 loc) · 1.21 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
cmake_minimum_required(VERSION 3.14)
project(BetterSpades C)
set(BETTERSPADES_MAJOR 0)
set(BETTERSPADES_MINOR 1)
set(BETTERSPADES_PATCH 5)
option(ENABLE_TOUCH "Enable touch support including ingame overlay" OFF)
option(ENABLE_ANDROID_FILE "Use SDL's file functions" OFF)
option(ENABLE_OPENGLES "Build for OpenGL ES" OFF)
option(ENABLE_SDL "Build against SDL backend" OFF)
option(ENABLE_GLFW "Build against GLFW3 backend" ON)
option(ENABLE_SOUND "Enable sound support using OpenAL" ON)
option(ENABLE_RPC "Enable Discord Rich Presence support" OFF)
if((ENABLE_ANDROID_FILE OR ENABLE_TOUCH OR ENABLE_OPENGLES) AND NOT ENABLE_SDL)
message(FATAL_ERROR "Enable SDL to use ENABLE_ANDROID_FILE, ENABLE_TOUCH or ENABLE_OPENGLES")
endif()
if(ENABLE_SDL AND ENABLE_GLFW)
message(FATAL_ERROR "Only one backend must be selected")
endif()
if(NOT ENABLE_SDL AND NOT ENABLE_GLFW)
message(FATAL_ERROR "Enable SDL or GLFW")
endif()
message(STATUS "Compiler is ${CMAKE_CXX_COMPILER_ID}")
message(STATUS "Build type is ${CMAKE_BUILD_TYPE}")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_options(-Ofast)
else()
add_compile_options(-Ofast -g -march=native)
endif()
endif()
add_subdirectory(src)