Add cmake check whether sys/sysmacros.h exists

Unfortunately 9ada8baca6 failed to compile
on FreeBSD due to the header not existing. So we need to check the
existance and properly guard with ifdef.
This commit is contained in:
Martin Gräßlin 2017-07-30 21:30:33 +02:00
parent 9ada8baca6
commit bc003c0228
3 changed files with 5 additions and 0 deletions

View file

@ -337,6 +337,7 @@ check_include_file("linux/fb.h" HAVE_LINUX_FB_H)
add_feature_info("linux/fb.h"
HAVE_LINUX_FB_H
"Required for the fbdev backend")
check_include_file("sys/sysmacros.h" HAVE_SYS_SYSMACROS_H)
########### global ###############
set(kwin_effects_dbus_xml ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.kwin.Effects.xml)

View file

@ -21,6 +21,7 @@
#cmakedefine01 HAVE_PR_SET_PDEATHSIG
#cmakedefine01 HAVE_SYS_PROCCTL_H
#cmakedefine01 HAVE_PROC_TRACE_CTL
#cmakedefine01 HAVE_SYS_SYSMACROS_H
#cmakedefine01 HAVE_BREEZE_DECO
#cmakedefine01 HAVE_UDEV
#if HAVE_BREEZE_DECO

View file

@ -29,7 +29,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDBusMetaType>
#include <sys/stat.h>
#include <config-kwin.h>
#if HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
#endif
#ifndef major
#include <sys/types.h>
#endif