Skip to content

Commit 46fa972

Browse files
committed
win32: dirty fix for DLL hell
1 parent 06822e4 commit 46fa972

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/driver/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ if (TARGET shady_fe_llvm)
1818
add_executable(vcc vcc.c)
1919
target_link_libraries(vcc PRIVATE driver api common)
2020
install(TARGETS vcc EXPORT shady_export_set)
21+
22+
add_custom_command(TARGET vcc POST_BUILD
23+
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:vcc> $<TARGET_RUNTIME_DLLS:vcc>
24+
COMMAND_EXPAND_LISTS
25+
)
2126
endif ()

src/shady/generator/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ function(add_generated_file)
1616
set(F_TARGET_NAME generate_${F_FILE_NAME})
1717
endif ()
1818
add_custom_target(${F_TARGET_NAME} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${F_FILE_NAME})
19+
20+
# This hacky job is required for being able to run built targets in-place when generating the code
21+
# This is also required for the various drivers but since they're built in the same directory it will work for now
22+
add_custom_command(TARGET ${GENERATOR_NAME} POST_BUILD
23+
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:${GENERATOR_NAME}> $<TARGET_RUNTIME_DLLS:${GENERATOR_NAME}>
24+
COMMAND_EXPAND_LISTS
25+
)
1926
endfunction()

0 commit comments

Comments
 (0)