-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
39 lines (33 loc) · 1.21 KB
/
CMakeLists.txt
File metadata and controls
39 lines (33 loc) · 1.21 KB
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
39
cmake_minimum_required(VERSION 3.15)
project(ResponsiveWin32RenderThread C)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
add_executable(ResponsiveWin32RenderThread
main.c
)
# Suppress MSVC secure CRT warnings (optional)
if (MSVC)
target_compile_options(ResponsiveWin32RenderThread PRIVATE /W4 /permissive- /Zc:wchar_t /Zc:preprocessor)
target_compile_definitions(ResponsiveWin32RenderThread PRIVATE _CRT_SECURE_NO_WARNINGS)
# Build as a GUI subsystem (no console window)
set_target_properties(ResponsiveWin32RenderThread PROPERTIES
LINK_FLAGS "/SUBSYSTEM:WINDOWS /ENTRY:wWinMainCRTStartup"
)
else()
target_compile_options(ResponsiveWin32RenderThread PRIVATE -Wall -Wextra -Wpedantic)
if (MINGW)
# -mwindows removes console
target_link_options(ResponsiveWin32RenderThread PRIVATE -mwindows)
endif()
endif()
# Windows system libs
target_link_libraries(ResponsiveWin32RenderThread PRIVATE
user32
gdi32
opengl32
winmm
)
# Enable unicode (optional)
target_compile_definitions(ResponsiveWin32RenderThread PRIVATE UNICODE _UNICODE)
# Organize in an IDE
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES main.c)