File tree 3 files changed +61
-1
lines changed
3 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,10 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
143
143
configure_file ("${CMAKE_SOURCE_DIR} /cmake/cpack/${CMAKE_PROJECT_NAME} .desktop.in"
144
144
"${CMAKE_BINARY_DIR} /${CMAKE_PROJECT_NAME} .desktop" @ONLY)
145
145
146
+ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" )
147
+ set (OPENBSD TRUE )
148
+ set (HAVE_SNDIO TRUE )
149
+
146
150
elseif (APPLE )
147
151
if ("${CMAKE_OSX_DEPLOYMENT_TARGET} " STREQUAL "" )
148
152
message (STATUS "Build for macOS target: local version" )
@@ -276,6 +280,12 @@ if(LINUX)
276
280
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_CM108" )
277
281
endif ()
278
282
283
+ elseif (HAVE_SNDIO)
284
+ find_package (sndio REQUIRED)
285
+ if (SNDIO_FOUND)
286
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_SNDIO" )
287
+ endif ()
288
+
279
289
elseif (NOT WIN32 AND NOT CYGWIN )
280
290
find_package (Portaudio REQUIRED)
281
291
if (PORTAUDIO_FOUND)
@@ -289,6 +299,8 @@ else()
289
299
set (UDEV_LIBRARIES "" )
290
300
set (PORTAUDIO_INCLUDE_DIRS "" )
291
301
set (PORTAUDIO_LIBRARIES "" )
302
+ set (SNDIO_INCLUDE_DIRS "" )
303
+ set (SNDIO_LIBRARIES "" )
292
304
endif ()
293
305
294
306
# manage and fetch new data
Original file line number Diff line number Diff line change
1
+ # - Try to find sndio
2
+ #
3
+ # SNDIO_FOUND - system has sndio
4
+ # SNDIO_LIBRARIES - location of the library for sndio
5
+ # SNDIO_INCLUDE_DIRS - location of the include files for sndio
6
+
7
+ set (SNDIO_ROOT_DIR
8
+ "${SNDIO_ROOT_DIR} "
9
+ CACHE
10
+ PATH
11
+ "Directory to search for sndio" )
12
+
13
+ # no need to check pkg-config
14
+
15
+ find_path (SNDIO_INCLUDE_DIRS
16
+ NAMES
17
+ sndio.h
18
+ PATHS
19
+ /usr/local/include
20
+ /usr/include
21
+ /opt/local/include
22
+ HINTS
23
+ ${SNDIO_ROOT_DIR}
24
+ )
25
+
26
+ find_library (SNDIO_LIBRARIES
27
+ NAMES
28
+ sndio
29
+ PATHS
30
+ /usr/local/lib
31
+ /usr/lib
32
+ /usr/lib64
33
+ /opt/local/lib
34
+ HINTS
35
+ ${SNDIIO_ROOT_DIR}
36
+ )
37
+
38
+
39
+ include (FindPackageHandleStandardArgs)
40
+ find_package_handle_standard_args(SNDIO DEFAULT_MSG SNDIO_INCLUDE_DIRS SNDIO_LIBRARIES)
41
+
42
+ mark_as_advanced (SNDIO_INCLUDE_DIRS SNDIO_LIBRARIES)
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ include_directories(
7
7
${ALSA_INCLUDE_DIRS}
8
8
${UDEV_INCLUDE_DIRS}
9
9
${PORTAUDIO_INCLUDE_DIRS}
10
+ ${SNDIO_INCLUDE_DIRS}
10
11
${CUSTOM_GEOTRANZ_DIR}
11
12
)
12
13
@@ -107,7 +108,11 @@ if(LINUX)
107
108
list (REMOVE_ITEM direwolf_SOURCES
108
109
dwgpsd.c
109
110
)
110
- else () # macOS freebsd openbsd
111
+ elseif (HAVE_SNDIO)
112
+ list (APPEND direwolf_SOURCES
113
+ audio.c
114
+ )
115
+ else () # macOS freebsd
111
116
list (APPEND direwolf_SOURCES
112
117
audio_portaudio.c
113
118
)
@@ -127,6 +132,7 @@ target_link_libraries(direwolf
127
132
${ALSA_LIBRARIES}
128
133
${UDEV_LIBRARIES}
129
134
${PORTAUDIO_LIBRARIES}
135
+ ${SNDIO_LIBRARIES}
130
136
)
131
137
132
138
if (WIN32 OR CYGWIN )
You can’t perform that action at this time.
0 commit comments