Fix glibc build & other Linux warnings

This commit is contained in:
a_dinosaur committed 2023-01-18 23:48:41 +11:00
1 parent dfd8f65111
commit 2112643e94
1 file changed
+6 -2
+6 -2
View File
@@ -5,14 +5,18 @@ set(TARGET padlab)
option(USE_OPENGL "Use legacy OpenGL for drawing" ON)
set(CMAKE_C_STANDARD 99)
if (C_COMPILER_ID IN_LIST "GNU;Clang;AppleClang")
set(GNU)
set(GNU_COMPILERS GNU Clang AppleClang)
if (CMAKE_C_COMPILER_ID IN_LIST GNU_COMPILERS)
set(GNU 1)
elseif (MSVC)
string(REPLACE "/W3" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
endif()
find_package(SDL2 REQUIRED)
if (USE_OPENGL)
if (NOT DEFINED OpenGL_GL_PREFERENCE)
set(OpenGL_GL_PREFERENCE "GLVND")
endif()
find_package(OpenGL REQUIRED)
endif()