From 39497fe67e23217dbce06ff19597666bfe16637f Mon Sep 17 00:00:00 2001 From: shg8 Date: Wed, 13 Mar 2024 18:59:30 -0700 Subject: [PATCH] Read compiled SPIR-V in binary mode --- CMakeLists.txt | 8 ++++++-- cmake/embedfile.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0b9632..fe02376 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,11 @@ FetchContent_Declare(spdlog GIT_REPOSITORY https://github.com/gabime/spdlog.git GIT_TAG v1.13.0 ) -FetchContent_MakeAvailable(spdlog) +FetchContent_GetProperties(spdlog) +if (NOT spdlog_POPULATED) + FetchContent_Populate(spdlog) + add_subdirectory(${spdlog_SOURCE_DIR} ${spdlog_BINARY_DIR}) +endif() FetchContent_Declare(imgui GIT_REPOSITORY https://github.com/ocornut/imgui.git @@ -178,7 +182,7 @@ target_include_directories(vulkan_splatting PUBLIC ${spdlog_SOURCE_DIR}/include ) -target_link_libraries(vulkan_splatting PUBLIC glfw libenvpp::libenvpp) +target_link_libraries(vulkan_splatting PUBLIC glfw libenvpp::libenvpp spdlog::spdlog) target_link_libraries(vulkan_splatting PUBLIC Vulkan::Vulkan) if (UNIX) target_link_libraries(vulkan_splatting PUBLIC ${CMAKE_DL_LIBS}) diff --git a/cmake/embedfile.c b/cmake/embedfile.c index ad6b3ae..a23fb9e 100644 --- a/cmake/embedfile.c +++ b/cmake/embedfile.c @@ -21,7 +21,7 @@ int main(int argc, char** argv) } const char* sym = argv[1]; - FILE* in = open_or_exit(argv[2], "r"); + FILE* in = open_or_exit(argv[2], "rb"); FILE* out = open_or_exit(argv[3], "a"); fprintf(out, "static const unsigned char %s[] = {\n", sym);