From 9c80377ce1b70a99b0208ab2118db80413c69c1f Mon Sep 17 00:00:00 2001 From: Andrew Richards Date: Tue, 10 Dec 2024 14:16:48 +0000 Subject: [PATCH] Fixed SimulVulkan_MT and DelayLoadLinkAssimp linking for non-source build. --- CMakeLists.txt | 3 ++- Vulkan/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 258b5acb..2d6243b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,12 +42,13 @@ if(PLATFORM_BUILD_ASSIMP) endif() if(PLATFORM_USE_ASSIMP) -function(DelayLoadLinkAssimp target) + function(DelayLoadLinkAssimp target) if (PLATFORM_BUILD_ASSIMP) target_link_libraries(${target} PRIVATE assimp) target_link_options(${target} PRIVATE "/DELAYLOAD:$.dll") else() set(ASSIMP_LIBNAME assimp-vc${MSVC_TOOLSET_VERSION}-mt$<$:d>) + target_link_libraries(${target} PRIVATE "${ASSIMP_LIBNAME}.dll") target_link_options(${target} INTERFACE "/DELAYLOAD:${ASSIMP_LIBNAME}.dll") endif() endfunction() diff --git a/Vulkan/CMakeLists.txt b/Vulkan/CMakeLists.txt index afee32c6..0a7475a7 100644 --- a/Vulkan/CMakeLists.txt +++ b/Vulkan/CMakeLists.txt @@ -36,9 +36,9 @@ endif() # Add in vk_mem_alloc.h set(HEADERS ${HEADERS} "${SIMUL_PLATFORM_DIR}/External/VulkanMemoryAllocator/include/vk_mem_alloc.h") -if(SIMUL_SOURCE_BUILD) - add_static_library( SimulVulkan SOURCES ${SOURCES} ${HEADERS} ${SHADER_DEFS} ${SHADER_INCLUDES} DEFINITIONS ${VK_DEFS} FOLDER ${SIMUL_PLATFORM_FOLDER_PREFIX}) +add_static_library( SimulVulkan SOURCES ${SOURCES} ${HEADERS} ${SHADER_DEFS} ${SHADER_INCLUDES} DEFINITIONS ${VK_DEFS} FOLDER ${SIMUL_PLATFORM_FOLDER_PREFIX}) +if(SIMUL_SOURCE_BUILD) add_dependencies(SimulVulkan${STATIC_LINK_SUFFIX} SimulCrossPlatform${STATIC_LINK_SUFFIX}) if(PLATFORM_WINDOWS) target_compile_definitions(SimulVulkan${STATIC_LINK_SUFFIX} PRIVATE VK_USE_PLATFORM_WIN32_KHR )