summaryrefslogtreecommitdiff
path: root/glad.CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'glad.CMakeLists.txt')
-rw-r--r--glad.CMakeLists.txt13
1 files changed, 10 insertions, 3 deletions
diff --git a/glad.CMakeLists.txt b/glad.CMakeLists.txt
index b77ab48..7d7c2fc 100644
--- a/glad.CMakeLists.txt
+++ b/glad.CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.19)
+cmake_minimum_required(VERSION 3.21)
set(CMAKE_C_STANDARD 99)
@@ -8,8 +8,6 @@ add_library(
"src/glad.c"
)
-target_enable_optimisations(glad)
-
target_include_directories(
glad PUBLIC
@@ -20,6 +18,15 @@ if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang|GNU")
target_compile_options(
glad PRIVATE
+ $<IF:$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">,-Og,-Ofast>
+ -fdiagnostics-color=always
-g
)
+elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ target_compile_options(
+ glad PRIVATE
+
+ /O2
+ $<IF:$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">,/Zo>
+ )
endif()