build: ensure assets are copied to cmake binary directory

this prevents needing to manually copy assets over to avoid a
"Document for menu not loaded!" error
This commit is contained in:
briaguya 2024-06-04 21:45:54 -04:00
parent bec699f0bd
commit 5fa1f70b69
1 changed files with 6 additions and 0 deletions

View File

@ -250,6 +250,12 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(Zelda64Recompiled PRIVATE "-latomic -static-libstdc++" ${CMAKE_DL_LIBS} Threads::Threads)
endif()
add_custom_command(
TARGET Zelda64Recompiled PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_SOURCE_DIR}/assets ${CMAKE_CURRENT_BINARY_DIR}/assets
COMMENT "Copying assets if different"
)
target_link_libraries(Zelda64Recompiled PRIVATE
PatchesLib
RecompiledFuncs