diff options
| author | ladevieq <qladevie@wanadev.fr> | 2021-03-05 13:36:58 +0100 |
|---|---|---|
| committer | ladevieq <qladevie@wanadev.fr> | 2021-03-05 13:36:58 +0100 |
| commit | 7887cb560a4efd80f9124d32ec177913c80259a1 (patch) | |
| tree | 0950d40af93071634224dc2423b09a8c6fa9cba9 | |
| parent | 2218ad410c01c8e3ea8416dd019d0c3072fbb1cf (diff) | |
Fix linux build
| -rw-r--r-- | src/CMakeLists.txt | 10 | ||||
| -rw-r--r-- | src/vk-renderer.cpp | 4 |
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); |
