diff --git a/CMakeLists.txt b/CMakeLists.txt index e6b472150..5a8147a51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,17 @@ if(NOT DEFINED EXPORT_ALL_SYMBOLS) set(EXPORT_ALL_SYMBOLS TRUE) endif() +# BSD +if(${CMAKE_SYSTEM_NAME} MATCHES "BSD") + set(BSD TRUE) + if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + set(FREEBSD TRUE) + endif() + if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") + set(OPENBSD TRUE) + endif() +endif() + # Configure MSVC Runtime if(MSVC) include(MSVCRuntime) @@ -179,14 +190,17 @@ if(CMAKE_COMPILER_IS_GNUCC) if(Wimplicit-function-declaration) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wimplicit-function-declaration") endif() - CHECK_C_COMPILER_FLAG (-Wredundant-decls Wredundant-decls) - if(Wredundant-decls) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wredundant-decls") + + if (NOT OPENBSD) + CHECK_C_COMPILER_FLAG (-Wredundant-decls Wredundant-decls) + if(Wredundant-decls) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wredundant-decls") + endif() endif() if(CMAKE_BUILD_TYPE STREQUAL "Release") set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG") - if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") + if(NOT OPENBSD) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") endif() @@ -360,17 +374,6 @@ if(APPLE) endif() endif(APPLE) -# BSD -if(${CMAKE_SYSTEM_NAME} MATCHES "BSD") - set(BSD TRUE) - if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") - set(FREEBSD TRUE) - endif() - if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") - set(OPENBSD TRUE) - endif() -endif() - # OpenBSD if(OPENBSD) set(WITH_ALSA "OFF") diff --git a/winpr/libwinpr/crt/alignment.c b/winpr/libwinpr/crt/alignment.c index c7ec3795a..8bb3f085d 100644 --- a/winpr/libwinpr/crt/alignment.c +++ b/winpr/libwinpr/crt/alignment.c @@ -36,7 +36,7 @@ #ifdef __APPLE__ #include -#elif __FreeBSD__ +#elif __FreeBSD__ || __OpenBSD__ #include #else #include