]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
cmake: Make DBUS_SESSION_SOCKET_DIR in CMakeCache.txt consistent with config.h
authorRalf Habacker <ralf.habacker@freenet.de>
Mon, 28 Apr 2025 14:32:02 +0000 (14:32 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 16 May 2025 10:22:11 +0000 (10:22 +0000)
It's unexpected to have DBUS_SESSION_SOCKET_DIR take different values in
CMakeCache.txt, which lists the variables that are available to be set
by the caller, and in config.h, which makes their final values available
to the C code. If DBUS_SESSION_SOCKET_DIR is empty and we are running
on Unix, set it to its dynamically-chosen fallback before storing it in
the cache.

[smcv: Add commit message]
Co-authored-by: Simon McVittie <smcv@collabora.com>
CMakeLists.txt

index 82c1493a237f3c23042e7fc0f8e82dec03cdd7a4..acda97525c01b3af7b6d05e2482c5b21a9ed25d6 100644 (file)
@@ -562,10 +562,10 @@ if(MSVC_IDE)
     file(REMOVE ${PROJECT_BINARY_DIR}/data/dbus-1/services)
 endif()
 
-set(DBUS_SESSION_SOCKET_DIR "" CACHE STRING "Default directory for session socket on Unix")
 if(UNIX AND NOT DBUS_SESSION_SOCKET_DIR)
     set(DBUS_SESSION_SOCKET_DIR /tmp)
 endif()
+set(DBUS_SESSION_SOCKET_DIR "${DBUS_SESSION_SOCKET_DIR}" CACHE STRING "Default directory for session socket on Unix")
 
  # Not used on Windows, where there is no system bus
 set(DBUS_SYSTEM_PID_FILE ${DBUS_RUNSTATEDIR}/dbus/pid)