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.
This commit is contained in:
Sam Edwards 2019-04-26 03:45:30 -06:00
parent 65d11a4cfa
commit cfa4878955
2 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -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)