--- utilities/CMakeLists.txt.orig	2024-07-12 19:15:25 UTC
+++ utilities/CMakeLists.txt
@@ -25,13 +25,19 @@ MSVC_CPPCHECK_DISABLE()
 DISABLE_MISSING_PROFILE_WARNING()
 MSVC_CPPCHECK_DISABLE()
 
-IF(NOT CMAKE_CROSSCOMPILING)
+IF(WITHOUT_CLIENTLIBS)
   MYSQL_ADD_EXECUTABLE(comp_err
     comp_err.cc
     COMPONENT Test
     LINK_LIBRARIES mysys
+    SKIP_INSTALL)
+ELSE(WITHOUT_CLIENTLIBS)
+  MYSQL_ADD_EXECUTABLE(comp_err
+    comp_err.cc
+    COMPONENT Test
+    LINK_LIBRARIES mysys
     )
-ENDIF()
+ENDIF(WITHOUT_CLIENTLIBS)
 
 MYSQL_ADD_EXECUTABLE(comp_client_err
   comp_client_err.cc
@@ -114,10 +120,30 @@ MYSQL_ADD_EXECUTABLE(static_thread_local_test
   EXCLUDE_FROM_ALL
   )
 
+IF(WITHOUT_CLIENTLIBS)
 MYSQL_ADD_EXECUTABLE(my_print_defaults
   my_print_defaults.cc
   COMPONENT Server
   LINK_LIBRARIES mysys
+  SKIP_INSTALL )
+MYSQL_ADD_EXECUTABLE(perror
+  perror.cc
+  COMPONENT Server
+  DEPENDENCIES GenError
+  LINK_LIBRARIES mysys
+  SKIP_INSTALL )
+IF(BUILD_BUNDLED_LZ4)
+  MYSQL_ADD_EXECUTABLE(lz4_decompress
+    lz4_decompress.cc
+    COMPONENT Server
+    LINK_LIBRARIES ${LZ4_LIBRARY} mysys
+    SKIP_INSTALL )
+ENDIF()
+ELSE(WITHOUT_CLIENTLIBS)
+MYSQL_ADD_EXECUTABLE(my_print_defaults
+  my_print_defaults.cc
+  COMPONENT Server
+  LINK_LIBRARIES mysys
   )
 MYSQL_ADD_EXECUTABLE(perror
   perror.cc
@@ -132,12 +158,23 @@ ENDIF()
     LINK_LIBRARIES ext::lz4 mysys
     )
 ENDIF()
+ENDIF(WITHOUT_CLIENTLIBS)
 
+IF(WITHOUT_CLIENTLIBS)
 MYSQL_ADD_EXECUTABLE(zlib_decompress
   zlib_decompress.cc
   COMPONENT Server
   LINK_LIBRARIES ext::zlib mysys
+    SKIP_INSTALL )
+ELSE(WITHOUT_CLIENTLIBS)
+IF(BUILD_BUNDLED_ZLIB OR NOT OPENSSL_EXECUTABLE_HAS_ZLIB)
+  MYSQL_ADD_EXECUTABLE(zlib_decompress
+    zlib_decompress.cc
+    COMPONENT Server
+    LINK_LIBRARIES ${ZLIB_LIBRARY} mysys
   )
+ENDIF()
+ENDIF(WITHOUT_CLIENTLIBS)
 
 # All targets below belong to COMPONENT Server and depend on InnoDB.
 IF(WITHOUT_SERVER)
