Build fix for OpenBSD

fixes #8434
This commit is contained in:
Gunnar Beutner 2015-02-13 11:21:20 +01:00
parent 0f2598b43b
commit d8203f4bb5
2 changed files with 9 additions and 3 deletions

View File

@ -122,10 +122,16 @@ if(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
endif() endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU") if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
if(CMAKE_SYSTEM_NAME MATCHES AIX) if(CMAKE_SYSTEM_NAME MATCHES AIX)
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -g -lpthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -lpthread") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -lpthread")
elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pthread")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread")
else() else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif() endif()
endif() endif()

View File

@ -17,9 +17,9 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */ 02111-1307 USA. */
#ifndef __FreeBSD__ #if !defined(__FreeBSD__) && !defined(__OpenBSD__)
#include <alloca.h> #include <alloca.h>
#endif /* _FreeBSD__ */ #endif /* !__FreeBSD__ && !__OpenBSD__ */
#include <unistd.h> #include <unistd.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdbool.h> #include <stdbool.h>