CMake: Add proper dependencies for bin2cpp invocations

This commit is contained in:
TellowKrinkle 2021-09-04 20:35:43 -05:00 committed by tellowkrinkle
parent de7a92944f
commit 1fe352d8a6
2 changed files with 13 additions and 2 deletions

View File

@ -246,6 +246,8 @@ add_subdirectory(3rdparty/libchdr/libchdr EXCLUDE_FROM_ALL)
if(USE_NATIVE_TOOLS)
add_subdirectory(tools/bin2cpp EXCLUDE_FROM_ALL)
set(BIN2CPP bin2cpp)
set(BIN2CPPDEP bin2cpp)
else()
set(BIN2CPP perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl)
set(BIN2CPPDEP ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl)
endif()

View File

@ -537,6 +537,7 @@ else(WIN32)
arrow_bottom arrow_left arrow_right)
add_custom_command(
OUTPUT "${PADImgHeader}/${result_file}.h"
DEPENDS ${BIN2CPPDEP} "${PADImg}/${result_file}.png"
COMMAND ${BIN2CPP} "${PADImg}/${result_file}.png" "${PADImgHeader}/${result_file}" )
endforeach()
@ -1477,7 +1478,11 @@ foreach(res_file IN ITEMS
AppIcon16 AppIcon32 AppIcon64 BackgroundLogo Logo NoIcon ButtonIcon_Camera
ConfigIcon_Cpu ConfigIcon_Gamefixes ConfigIcon_MemoryCard
ConfigIcon_Paths ConfigIcon_Speedhacks ConfigIcon_Video Breakpoint_Active Breakpoint_Inactive)
add_custom_command(OUTPUT "${res_bin}/${res_file}.h" COMMAND ${BIN2CPP} "${res_src}/${res_file}.png" "${res_bin}/${res_file}" )
add_custom_command(
OUTPUT "${res_bin}/${res_file}.h"
DEPENDS ${BIN2CPPDEP} "${res_src}/${res_file}.png"
COMMAND ${BIN2CPP} "${res_src}/${res_file}.png" "${res_bin}/${res_file}"
)
endforeach()
### Generate Recording resource files
@ -1485,7 +1490,11 @@ endforeach()
foreach(res_file IN ITEMS
circlePressed controllerFull controllerHalf controllerThreeQuarters crossPressed downPressed l1Pressed l2Pressed l3Pressed leftPressed
r1Pressed r2Pressed r3Pressed rightPressed selectPressed squarePressed startPressed trianglePressed upPressed)
add_custom_command(OUTPUT "${res_rec_vp_src}/${res_file}.h" COMMAND ${BIN2CPP} "${res_rec_vp_src}/${res_file}.png" "${res_rec_vp_src}/${res_file}" )
add_custom_command(
OUTPUT "${res_rec_vp_src}/${res_file}.h"
DEPENDS ${BIN2CPPDEP} "${res_rec_vp_src}/${res_file}.png"
COMMAND ${BIN2CPP} "${res_rec_vp_src}/${res_file}.png" "${res_rec_vp_src}/${res_file}"
)
endforeach()
# additonal include directories