summaryrefslogblamecommitdiff
path: root/glad.CMakeLists.txt
blob: 0ec0384223aa249607df389b84d90bffc558b5f4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                    




                        
 


                    









                                                

                                                                          

                  






                                                                   
       
cmake_minimum_required(VERSION 3.21)

set(CMAKE_C_STANDARD 99)

add_library(
	glad STATIC

	"src/glad.c"
)

target_include_directories(
	glad PUBLIC

	"include"
)

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()