Skip to content

Commit

Permalink
Fixed SimulVulkan_MT and DelayLoadLinkAssimp linking for non-source b…
Browse files Browse the repository at this point in the history
…uild.
  • Loading branch information
AndrewRichards-Code committed Dec 10, 2024
1 parent 2ef0763 commit 9c80377
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:$<TARGET_FILE_BASE_NAME:assimp>.dll")
else()
set(ASSIMP_LIBNAME assimp-vc${MSVC_TOOLSET_VERSION}-mt$<$<CONFIG:Debug>:d>)
target_link_libraries(${target} PRIVATE "${ASSIMP_LIBNAME}.dll")
target_link_options(${target} INTERFACE "/DELAYLOAD:${ASSIMP_LIBNAME}.dll")
endif()
endfunction()
Expand Down
4 changes: 2 additions & 2 deletions Vulkan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 9c80377

Please sign in to comment.