--- client/CMakeLists.txt.orig	2026-02-15 11:50:38.374086000 +0100
+++ client/CMakeLists.txt	2026-02-15 11:48:03.116396108 +0100
@@ -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
@@ -59,9 +64,11 @@ MYSQL_ADD_EXECUTABLE(mysqltest
   ENABLE_EXPORTS
   LINK_LIBRARIES mysqlclient
   )
+ENDIF()
 
 DOWNGRADE_STRINGOP_WARNINGS(mysqltest)
 
+IF(WITHOUT_SERVER)
 MYSQL_ADD_EXECUTABLE(mysqlcheck
   check/mysqlcheck.cc
   check/mysqlcheck_core.cc
@@ -302,7 +309,9 @@ ENDIF()
   TARGET_COMPILE_DEFINITIONS(mysqlbinlog PRIVATE DISABLE_PSI_MUTEX)
   TARGET_INCLUDE_DIRECTORIES(mysqlbinlog PRIVATE ${CMAKE_SOURCE_DIR}/sql)
 ENDIF()
+ENDIF()
 
+IF(WITHOUT_SERVER)
 MYSQL_ADD_EXECUTABLE(mysqladmin
   mysqladmin.cc
   multi_factor_passwordopt-vars.cc
@@ -317,10 +326,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)
