diff --git a/cmake/01-core.cmake b/cmake/01-core.cmake index 36ec8661..a3775317 100644 --- a/cmake/01-core.cmake +++ b/cmake/01-core.cmake @@ -31,8 +31,17 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors") +if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + # Need dprintf() for FreeBSD 11.1 and older + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WITH_DPRINTF") + + # libinotify uses c99 extension, so suppress this error + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c99-extensions") +endif() + if(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=parentheses-equality") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-zero-length-array") endif() set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") diff --git a/cmake/03-libs.cmake b/cmake/03-libs.cmake index be5d4b54..26661ae5 100644 --- a/cmake/03-libs.cmake +++ b/cmake/03-libs.cmake @@ -22,3 +22,8 @@ querylib(WITH_XRENDER "pkg-config" xcb-render libs dirs) querylib(WITH_XRM "pkg-config" xcb-xrm libs dirs) querylib(WITH_XSYNC "pkg-config" xcb-sync libs dirs) querylib(WITH_XCURSOR "pkg-config" xcb-cursor libs dirs) + +# FreeBSD Support +if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + querylib(TRUE "pkg-config" libinotify libs dirs) +endif() diff --git a/include/adapters/alsa/generic.hpp b/include/adapters/alsa/generic.hpp index 4595c2e4..2415946d 100644 --- a/include/adapters/alsa/generic.hpp +++ b/include/adapters/alsa/generic.hpp @@ -4,7 +4,11 @@ #include #else #include + +#ifndef __FreeBSD__ #include +#endif + #include #include #include