Browse Source

Set all HAVE_ macros on the top level

This keep everything consistent.
pull/1722/head
Pierre Ossman 4 months ago
parent
commit
fe4b0145de
4 changed files with 18 additions and 9 deletions
  1. 15
    0
      CMakeLists.txt
  2. 0
    5
      unix/x0vncserver/CMakeLists.txt
  3. 3
    3
      unix/x0vncserver/x0vncserver.cxx
  4. 0
    1
      vncviewer/CMakeLists.txt

+ 15
- 0
CMakeLists.txt View File

# X11 stuff. It's in a if() so that we can say REQUIRED # X11 stuff. It's in a if() so that we can say REQUIRED
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED) find_package(X11 REQUIRED)
if(X11_Xdamage_LIB)
add_definitions(-DHAVE_XDAMAGE)
endif()
if(X11_Xfixes_LIB)
add_definitions(-DHAVE_XFIXES)
endif()
if(X11_Xrandr_LIB)
add_definitions(-DHAVE_XRANDR)
endif()
if(X11_XTest_LIB)
add_definitions(-DHAVE_XTEST)
endif()
endif() endif()


# Check for zlib # Check for zlib
find_package(PkgConfig) find_package(PkgConfig)
if (PKG_CONFIG_FOUND) if (PKG_CONFIG_FOUND)
pkg_check_modules(LIBSYSTEMD libsystemd) pkg_check_modules(LIBSYSTEMD libsystemd)
if (LIBSYSTEMD_FOUND)
add_definitions(-DHAVE_LIBSYSTEMD)
endif()
endif() endif()
endif() endif()



+ 0
- 5
unix/x0vncserver/CMakeLists.txt View File



# systemd support (socket activation) # systemd support (socket activation)
if (LIBSYSTEMD_FOUND) if (LIBSYSTEMD_FOUND)
add_definitions(-DHAVE_SYSTEMD_H)
target_link_libraries(x0vncserver ${LIBSYSTEMD_LIBRARIES}) target_link_libraries(x0vncserver ${LIBSYSTEMD_LIBRARIES})
endif() endif()


if(X11_XTest_LIB) if(X11_XTest_LIB)
add_definitions(-DHAVE_XTEST)
target_link_libraries(x0vncserver ${X11_XTest_LIB}) target_link_libraries(x0vncserver ${X11_XTest_LIB})
else() else()
message(WARNING "No XTest extension. x0vncserver will be view-only.") message(WARNING "No XTest extension. x0vncserver will be view-only.")
endif() endif()


if(X11_Xdamage_LIB) if(X11_Xdamage_LIB)
add_definitions(-DHAVE_XDAMAGE)
target_link_libraries(x0vncserver ${X11_Xdamage_LIB}) target_link_libraries(x0vncserver ${X11_Xdamage_LIB})
else() else()
message(WARNING "No DAMAGE extension. x0vncserver will have to use the slower polling method.") message(WARNING "No DAMAGE extension. x0vncserver will have to use the slower polling method.")
endif() endif()


if(X11_Xfixes_LIB) if(X11_Xfixes_LIB)
add_definitions(-DHAVE_XFIXES)
target_link_libraries(x0vncserver ${X11_Xfixes_LIB}) target_link_libraries(x0vncserver ${X11_Xfixes_LIB})
else() else()
message(WARNING "No XFIXES extension. x0vncserver will not be able to show cursors.") message(WARNING "No XFIXES extension. x0vncserver will not be able to show cursors.")
endif() endif()


if(X11_Xrandr_LIB) if(X11_Xrandr_LIB)
add_definitions(-DHAVE_XRANDR)
target_link_libraries(x0vncserver ${X11_Xrandr_LIB}) target_link_libraries(x0vncserver ${X11_Xrandr_LIB})
else() else()
message(WARNING "No Xrandr extension. x0vncserver will not be able to resize session.") message(WARNING "No Xrandr extension. x0vncserver will not be able to resize session.")

+ 3
- 3
unix/x0vncserver/x0vncserver.cxx View File

#include <rfb/Timer.h> #include <rfb/Timer.h>
#include <network/TcpSocket.h> #include <network/TcpSocket.h>
#include <network/UnixSocket.h> #include <network/UnixSocket.h>
#ifdef HAVE_SYSTEMD_H
#ifdef HAVE_LIBSYSTEMD
# include <systemd/sd-daemon.h> # include <systemd/sd-daemon.h>
#endif #endif




static bool hasSystemdListeners() static bool hasSystemdListeners()
{ {
#ifdef HAVE_SYSTEMD_H
#ifdef HAVE_LIBSYSTEMD
// This also returns true on errors, because we then assume we were // This also returns true on errors, because we then assume we were
// meant to use systemd but failed somewhere // meant to use systemd but failed somewhere
return sd_listen_fds(0) != 0; return sd_listen_fds(0) != 0;


static int createSystemdListeners(std::list<SocketListener*> *listeners) static int createSystemdListeners(std::list<SocketListener*> *listeners)
{ {
#ifdef HAVE_SYSTEMD_H
#ifdef HAVE_LIBSYSTEMD
int count = sd_listen_fds(0); int count = sd_listen_fds(0);
if (count < 0) { if (count < 0) {
vlog.error("Error getting listening sockets from systemd: %s", vlog.error("Error getting listening sockets from systemd: %s",

+ 0
- 1
vncviewer/CMakeLists.txt View File

target_link_libraries(vncviewer ${X11_Xi_LIB}) target_link_libraries(vncviewer ${X11_Xi_LIB})


if(X11_Xrandr_LIB) if(X11_Xrandr_LIB)
add_definitions(-DHAVE_XRANDR)
target_link_libraries(vncviewer ${X11_Xrandr_LIB}) target_link_libraries(vncviewer ${X11_Xrandr_LIB})
endif() endif()
endif() endif()

Loading…
Cancel
Save