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.

This commit is contained in:
Bryan Everly 2015-04-22 09:19:04 -04:00
parent d5e7314392
commit 8f19bd1825

View File

@ -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()
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")