feat: add ASIO signal handling for graceful shutdown
- Add asio dependency for async signal handling - Register SIGINT and SIGTERM to quit the application - Poll signals each frame for non-blocking shutdown - Q key and Ctrl+C both cleanly exit the program
This commit is contained in:
+2
-1
@@ -11,9 +11,10 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/deps")
|
||||
find_package(fmt REQUIRED)
|
||||
find_package(glfw3 REQUIRED)
|
||||
find_package(glad REQUIRED)
|
||||
find_package(asio REQUIRED)
|
||||
|
||||
# Target setup
|
||||
add_executable(cuber "cuber.cpp" "cbt/window.cpp")
|
||||
target_include_directories(cuber PRIVATE ".")
|
||||
target_compile_features(cuber PRIVATE cxx_std_23)
|
||||
target_link_libraries(cuber PRIVATE fmt::fmt glfw::glfw glad::glad)
|
||||
target_link_libraries(cuber PRIVATE fmt::fmt glfw::glfw glad::glad asio::asio)
|
||||
|
||||
Reference in New Issue
Block a user