mirror of
https://github.com/gbdev/rgbds.git
synced 2026-05-08 19:09:36 +00:00
Copy DLLs to appropriate dir for install-less Windows testing
Co-authored-by: vulcandth <6394873+vulcandth@users.noreply.github.com>
This commit is contained in:
@@ -108,6 +108,12 @@ set_target_properties(rgbasm rgblink rgbfix rgbgfx PROPERTIES
|
||||
# The generator expression (even if a no-op) stops muti-config generators using a of "per-configuration subdirectory".
|
||||
RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_SOURCE_DIR}>)
|
||||
target_link_libraries(rgbgfx PRIVATE PNG::PNG)
|
||||
# Copy the DLLs in the output directory so the program can be run for testing without having to `install`.
|
||||
# From https://cmake.org/cmake/help/v4.3/manual/cmake-generator-expressions.7.html#genex:TARGET_RUNTIME_DLLS.
|
||||
add_custom_command(TARGET rgbgfx POST_BUILD COMMENT "Copying rgbgfx's DLLs"
|
||||
# It would be nice to symlink instead, but that only supports one file at a time.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:rgbgfx> $<TARGET_RUNTIME_DLLS:rgbgfx>
|
||||
COMMAND_EXPAND_LISTS VERBATIM)
|
||||
|
||||
# On Windows, you don't link against DLLs directly, but against an import library for that DLL.
|
||||
# This leads to, sometimes, the DLL being stored in a directory far away from the import library itself!
|
||||
|
||||
Reference in New Issue
Block a user