Bläddra i källkod

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.
Sam Edwards 6 år sedan
förälder
incheckning
cfa4878955
2 ändrade filer med 7 tillägg och 3 borttagningar
  1. 3 3
      cmake/macros/RunPzip.cmake
  2. 4 0
      panda/src/downloadertools/CMakeLists.txt

+ 3 - 3
cmake/macros/RunPzip.cmake

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

+ 4 - 0
panda/src/downloadertools/CMakeLists.txt

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