From 5fa1f70b698fe8d0102e89f19205db31d71250cf Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Tue, 4 Jun 2024 21:45:54 -0400 Subject: [PATCH] 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 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e281c1..50b9c84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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