Skip to content

Commit 8f87367

Browse files
committed
Cmake: remove unused defintions in Cmake
In the main Cmake, we were setting things like: -DLOCAL_BACKEND=1, -DUSB_BACKEND=1, -DNETWORK_BACKEND=1, -DXML_BACKEND=1, -DMATLAB_BINDINGS_API=1, but we don't use them anywhere, so remove them. Signed-off-by: Robin Getz <[email protected]>
1 parent 65cc33b commit 8f87367

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ if (NOT LIBIIO_VERSION_GIT)
154154
endif()
155155

156156
if(WITH_LOCAL_BACKEND)
157-
add_definitions(-DLOCAL_BACKEND=1)
158157
list(APPEND LIBIIO_CFILES local.c)
159158

160159
# Link with librt if present
@@ -177,7 +176,6 @@ if (LIBUSB_LIBRARIES AND LIBUSB_INCLUDE_DIR)
177176
option(WITH_USB_BACKEND "Enable the libusb backend" ON)
178177

179178
if(WITH_USB_BACKEND)
180-
add_definitions(-DUSB_BACKEND=1)
181179
list(APPEND LIBIIO_CFILES usb.c)
182180
list(APPEND LIBS_TO_LINK ${LIBUSB_LIBRARIES})
183181
set(IIOD_CLIENT 1)
@@ -211,7 +209,6 @@ if (LIBSERIALPORT_LIBRARIES AND LIBSERIALPORT_INCLUDE_DIR)
211209
message(WARNING "The installed version of libserialport is too old. The minimum version supported is 0.1.1. Disabling Serial support.")
212210
SET(WITH_SERIAL_BACKEND OFF)
213211
else()
214-
add_definitions(-DSERIAL_BACKEND=1)
215212
list(APPEND LIBIIO_CFILES serial.c)
216213
list(APPEND LIBS_TO_LINK ${LIBSERIALPORT_LIBRARIES})
217214

@@ -248,7 +245,6 @@ if(WITH_NETWORK_BACKEND)
248245
check_c_source_compiles("#include <unistd.h>\n#include <fcntl.h>\nint main(void) { int fd[2]; return pipe2(fd, O_CLOEXEC | O_NONBLOCK); }" HAS_PIPE2)
249246
endif()
250247

251-
add_definitions(-DNETWORK_BACKEND=1)
252248
list(APPEND LIBIIO_CFILES network.c)
253249

254250
find_library(AVAHI_CLIENT_LIBRARIES avahi-client)
@@ -300,7 +296,6 @@ if (LIBXML2_FOUND)
300296
if (WITH_XML_BACKEND)
301297
list(APPEND LIBIIO_CFILES xml.c)
302298

303-
add_definitions(${LIBXML2_DEFINITIONS} -DXML_BACKEND=1)
304299
include_directories(${LIBXML2_INCLUDE_DIR})
305300
list(APPEND LIBS_TO_LINK ${LIBXML2_LIBRARIES})
306301
endif()
@@ -430,7 +425,6 @@ add_subdirectory(bindings)
430425

431426
if (WITH_MATLAB_BINDINGS_API)
432427
list(APPEND LIBIIO_EXTRA_HEADERS bindings/matlab/iio-wrapper.h)
433-
add_definitions(-DMATLAB_BINDINGS_API=1)
434428
endif()
435429

436430
option(WITH_MAN "Generate on-line reference manuals (man pages)" OFF)

context.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
#include <errno.h>
2626
#include <string.h>
2727

28-
#ifdef _WIN32
29-
#define LOCAL_BACKEND 0
30-
#define NETWORK_BACKEND 1
31-
#endif
32-
3328
static const char xml_header[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
3429
"<!DOCTYPE context ["
3530
"<!ELEMENT context (device | context-attribute)*>"

0 commit comments

Comments
 (0)