aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/vk-renderer.cpp4
2 files changed, 8 insertions, 6 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 04dc37e..5380cde 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,6 +7,8 @@ if(UNIX)
include_directories(${X11_xcb_INCLUDE_PATH})
endif()
+set(LIBRARIES imgui::imgui)
+
add_executable(
path-tracer
main.cpp
@@ -22,10 +24,8 @@ add_executable(
window.cpp
)
-target_link_libraries(path-tracer PRIVATE imgui::imgui)
-
if(UNIX)
- target_link_libraries(path-tracer ${CMAKE_DL_LIBS} ${X11_xcb_LIB})
- target_link_libraries(path-tracer ${CMAKE_DL_LIBS} ${X11_xkbcommon_LIB})
- target_link_libraries(path-tracer ${CMAKE_DL_LIBS} ${X11_xkbcommon_X11_LIB})
+ list(APPEND LIBRARIES ${CMAKE_DL_LIBS} ${X11_xcb_LIB} ${X11_xkbcommon_LIB} ${X11_xkbcommon_X11_LIB})
endif()
+
+target_link_libraries(path-tracer PRIVATE ${LIBRARIES})
diff --git a/src/vk-renderer.cpp b/src/vk-renderer.cpp
index 0584ecf..7808f3f 100644
--- a/src/vk-renderer.cpp
+++ b/src/vk-renderer.cpp
@@ -2,6 +2,8 @@
#include <cstring>
#include <cassert>
+#include <functional>
+
#include "imgui.h"
#include "vk-renderer.hpp"
#include "thirdparty/vk_mem_alloc.h"
@@ -355,7 +357,7 @@ void vkrenderer::recreate_swapchain() {
platform_surface,
min_swapchain_image_count,
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT,
- std::optional<std::reference_wrapper<Swapchain>> { swapchain }
+ std::optional<std::reference_wrapper<Swapchain>> { std::ref(swapchain) }
);
api.destroy_images(accumulation_images);