mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-01 03:18:07 +02:00
cmake: Fix DBUS_SESSION_SOCKET_DIR when cross-compiling
Inferring it from the environment is not correct, since the host system could have a different temporary directory defined. Instead of guessing based on the host, require the user to pass an explicit directory when cross-compiling. This is helpful for me since I am cross-compiling for FreeBSD from macOS and on my host TMPDIR is set to /var/folders/<random characters>/T/ instead of the expected /tmp.
This commit is contained in:
parent
302f85d45d
commit
e827309976
2 changed files with 10 additions and 1 deletions
|
|
@ -575,8 +575,14 @@ if(MSVC_IDE)
|
|||
endif()
|
||||
|
||||
#### Find socket directories
|
||||
set(DBUS_SESSION_SOCKET_DIR "" CACHE STRING "Default directory for session socket")
|
||||
if(UNIX)
|
||||
if(NOT $ENV{TMPDIR} STREQUAL "")
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
if (NOT DBUS_SESSION_SOCKET_DIR)
|
||||
message(FATAL_ERROR "cannot autodetect session socket directory "
|
||||
"when crosscompiling, pass -DDBUS_SESSION_SOCKET_DIR=...")
|
||||
endif()
|
||||
elseif(NOT $ENV{TMPDIR} STREQUAL "")
|
||||
set(DBUS_SESSION_SOCKET_DIR $ENV{TMPDIR})
|
||||
elseif(NOT $ENV{TEMP} STREQUAL "")
|
||||
set(DBUS_SESSION_SOCKET_DIR $ENV{TEMP})
|
||||
|
|
|
|||
|
|
@ -179,6 +179,9 @@ DBUS_SESSION_BUS_LISTEN_ADDRESS:STRING=autolaunch:
|
|||
// session bus fallback address for clients
|
||||
DBUS_SESSION_BUS_CONNECT_ADDRESS:STRING=autolaunch:
|
||||
|
||||
//Default directory for session socket
|
||||
DBUS_SESSION_SOCKET_DIR:STRING=/tmp
|
||||
|
||||
// system bus default address (only useful on Unix)
|
||||
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS:STRING=unix:path=/var/run/dbus/system_bus_socket
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue