From 7887cb560a4efd80f9124d32ec177913c80259a1 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Fri, 5 Mar 2021 13:36:58 +0100 Subject: Fix linux build --- src/CMakeLists.txt | 10 +++++----- src/vk-renderer.cpp | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') 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 #include +#include + #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> { swapchain } + std::optional> { std::ref(swapchain) } ); api.destroy_images(accumulation_images); -- cgit v1.3