mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
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:
parent
65d11a4cfa
commit
cfa4878955
@ -1,5 +1,5 @@
|
|||||||
function(run_pzip target_name source destination glob)
|
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.
|
# If pzip isn't built, we just copy instead.
|
||||||
file(COPY "${source}"
|
file(COPY "${source}"
|
||||||
DESTINATION "${destination}"
|
DESTINATION "${destination}"
|
||||||
@ -22,9 +22,9 @@ function(run_pzip target_name source destination glob)
|
|||||||
list(APPEND dstfiles "${destination}/${dstfile}")
|
list(APPEND dstfiles "${destination}/${dstfile}")
|
||||||
|
|
||||||
add_custom_command(OUTPUT "${destination}/${dstfile}"
|
add_custom_command(OUTPUT "${destination}/${dstfile}"
|
||||||
COMMAND pzip -c > "${dstfile}" < "${srcfile}"
|
COMMAND host_pzip -c > "${dstfile}" < "${srcfile}"
|
||||||
WORKING_DIRECTORY "${destination}"
|
WORKING_DIRECTORY "${destination}"
|
||||||
DEPENDS pzip
|
DEPENDS host_pzip
|
||||||
COMMENT "")
|
COMMENT "")
|
||||||
|
|
||||||
endforeach(filename)
|
endforeach(filename)
|
||||||
|
@ -38,6 +38,10 @@ if(HAVE_ZLIB)
|
|||||||
add_executable(pzip pzip.cxx)
|
add_executable(pzip pzip.cxx)
|
||||||
target_link_libraries(pzip panda)
|
target_link_libraries(pzip panda)
|
||||||
|
|
||||||
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
add_executable(host_pzip ALIAS pzip)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(punzip punzip.cxx)
|
add_executable(punzip punzip.cxx)
|
||||||
target_link_libraries(punzip panda)
|
target_link_libraries(punzip panda)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user