mirror of
https://github.com/GayPizzaSpecifications/padlab.git
synced 2025-08-03 21:21:33 +00:00
It's also now no longer possible to trigger NW & SE angles when digital is set to 4 direction.
27 lines
653 B
CMake
27 lines
653 B
CMake
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
|
|
project(padlab C)
|
|
set(TARGET padlab)
|
|
|
|
option(USE_OPENGL "Use legacy OpenGL for drawing" ON)
|
|
|
|
set(CMAKE_C_STANDARD 99)
|
|
|
|
find_package(SDL2 REQUIRED)
|
|
if (USE_OPENGL)
|
|
find_package(OpenGL REQUIRED)
|
|
endif()
|
|
|
|
set(SOURCES
|
|
maths.h
|
|
draw.h $<IF:$<BOOL:${USE_OPENGL}>,draw_opengl.c,draw.c>
|
|
stick.c stick.h
|
|
analogue.c)
|
|
|
|
add_executable(${TARGET} ${SOURCES})
|
|
target_link_libraries(${TARGET}
|
|
SDL2::SDL2 $<$<BOOL:${USE_OPENGL}>:OpenGL::GL> m)
|
|
target_compile_options(${TARGET} PRIVATE
|
|
-Wall -Wextra -pedantic -Wno-unused-parameter)
|
|
target_compile_definitions(${TARGET} PRIVATE
|
|
$<$<BOOL:${USE_OPENGL}>:USE_OPENGL>)
|