From 8f19bd1825b3ea8de6a9eaa0df9cdc95c26eff69 Mon Sep 17 00:00:00 2001 From: Bryan Everly Date: Wed, 22 Apr 2015 09:19:04 -0400 Subject: [PATCH 1/2] Moved declaration of OPENBSD to higher in the file to clean some things up. Also, removed -Wredundant-decls from OpenBSD because the OpenBSD standard include files have some redundant declarations that generate a large number of compiler warnings. --- CMakeLists.txt | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) 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") From cb66f3ee708c6d8609593af34fcb77436db3fd96 Mon Sep 17 00:00:00 2001 From: Bryan Everly Date: Wed, 22 Apr 2015 09:50:50 -0400 Subject: [PATCH 2/2] Removed compiler warning about obsolete header file in OpenBSD --- winpr/libwinpr/crt/alignment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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