From cfa48789553a51d2dffc0892f0fb5475673ff474 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 26 Apr 2019 03:45:30 -0600 Subject: [PATCH] CMake: Use the same host_ prefix for pzip as we do for interrogate This is for better cross-compilation friendliness, so the pzip binary used during the build doesn't have to be the same as the pzip binary produced during the build. --- cmake/macros/RunPzip.cmake | 6 +++--- panda/src/downloadertools/CMakeLists.txt | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/macros/RunPzip.cmake b/cmake/macros/RunPzip.cmake index 3a4d2e4d0f..1e4e777c20 100644 --- a/cmake/macros/RunPzip.cmake +++ b/cmake/macros/RunPzip.cmake @@ -1,5 +1,5 @@ function(run_pzip target_name source destination glob) - if(NOT TARGET pzip) + if(NOT TARGET host_pzip) # If pzip isn't built, we just copy instead. file(COPY "${source}" DESTINATION "${destination}" @@ -22,9 +22,9 @@ function(run_pzip target_name source destination glob) list(APPEND dstfiles "${destination}/${dstfile}") add_custom_command(OUTPUT "${destination}/${dstfile}" - COMMAND pzip -c > "${dstfile}" < "${srcfile}" + COMMAND host_pzip -c > "${dstfile}" < "${srcfile}" WORKING_DIRECTORY "${destination}" - DEPENDS pzip + DEPENDS host_pzip COMMENT "") endforeach(filename) diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt index a306fe7ebb..5de61edac2 100644 --- a/panda/src/downloadertools/CMakeLists.txt +++ b/panda/src/downloadertools/CMakeLists.txt @@ -38,6 +38,10 @@ if(HAVE_ZLIB) add_executable(pzip pzip.cxx) target_link_libraries(pzip panda) + if(NOT CMAKE_CROSSCOMPILING) + add_executable(host_pzip ALIAS pzip) + endif() + add_executable(punzip punzip.cxx) target_link_libraries(punzip panda)