--- client/CMakeLists.txt.orig	2024-09-17 10:40:37 UTC
+++ client/CMakeLists.txt
@@ -26,9 +26,12 @@ DISABLE_MISSING_PROFILE_WARNING()
 # We are not interesting in profiling clients.
 DISABLE_MISSING_PROFILE_WARNING()
 
+IF(WITHOUT_SERVER)
 ## Subdirectory for mysql_migrate_keyring code.
 ADD_SUBDIRECTORY(migrate_keyring)
+ENDIF()
 
+IF(WITHOUT_SERVER)
 MYSQL_ADD_EXECUTABLE(mysql
   ${CMAKE_SOURCE_DIR}/sql-common/net_ns.cc
   completion_hash.cc
@@ -42,7 +45,9 @@ MYSQL_ADD_EXECUTABLE(mysql
   ${CMAKE_SOURCE_DIR}/sql-common/sql_string.cc
   LINK_LIBRARIES mysqlclient ${EDITLINE_LIBRARY}
   )
+ENDIF()
 
+IF(NOT WITHOUT_SERVER)
 MYSQL_ADD_EXECUTABLE(mysqltest
   mysqltest.cc
   mysqltest/error_names.cc
@@ -64,6 +69,9 @@ ENDIF()
   TARGET_LINK_OPTIONS(mysqltest PRIVATE -Wno-error=stringop-overflow)
 ENDIF()
 
+ENDIF()
+
+IF(WITHOUT_SERVER)
 MYSQL_ADD_EXECUTABLE(mysqlcheck
   check/mysqlcheck.cc
   check/mysqlcheck_core.cc
@@ -289,7 +297,9 @@ TARGET_INCLUDE_DIRECTORIES(mysqlbinlog PRIVATE ${CMAKE
 
 TARGET_COMPILE_DEFINITIONS(mysqlbinlog PRIVATE DISABLE_PSI_MUTEX)
 TARGET_INCLUDE_DIRECTORIES(mysqlbinlog PRIVATE ${CMAKE_SOURCE_DIR}/sql)
+ENDIF()
 
+IF(WITHOUT_SERVER)
 MYSQL_ADD_EXECUTABLE(mysqladmin
   mysqladmin.cc
   multi_factor_passwordopt-vars.cc
@@ -304,10 +314,14 @@ MYSQL_ADD_EXECUTABLE(mysql_config_editor
   mysql_config_editor.cc
   LINK_LIBRARIES mysqlclient
   )
+ENDIF()
+
+IF(NOT WITHOUT_SERVER)
 MYSQL_ADD_EXECUTABLE(mysql_secure_installation
   mysql_secure_installation.cc
   LINK_LIBRARIES mysqlclient
   )
+ENDIF()
 
 # "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/".
 IF(WIN32)
