Browse Source

build: exclude LMDB utilities from Windows CMake build, guard POSIX includes in mplay.c

file(GLOB) in libutun/CMakeLists.txt picked up mplay.c, mdb_dump.c and other
standalone LMDB tools that are not library code and fail on Windows. Filter them
out, keep only mdb.c + midl.c.
topo_upd
Evgeny 2 months ago
parent
commit
e5dd41e5b2
  1. 4
      lib/liblmdb/mplay.c
  2. 1
      tools/chatgui/libutun/CMakeLists.txt

4
lib/liblmdb/mplay.c

@ -13,13 +13,15 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#ifndef _WIN32
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#endif
#include "lmdb.h"

1
tools/chatgui/libutun/CMakeLists.txt

@ -9,6 +9,7 @@ set(TRANSPORT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../transport)
# ============================================================================
file(GLOB UASYNC_SOURCES "${LIB_DIR}/*.c" "${LIB_DIR}/liblmdb/*.c")
list(FILTER UASYNC_SOURCES EXCLUDE REGEX "/lmdb/(mtest[0-9]*\\.c|mtest\\.c|mdb_copy\\.c|mdb_dump\\.c|mdb_load\\.c|mdb_stat\\.c|mplay\\.c)$")
add_library(uasync STATIC ${UASYNC_SOURCES})

Loading…
Cancel
Save