Skip to content

Commit

Permalink
Fix build errors on MSYS platform
Browse files Browse the repository at this point in the history
  • Loading branch information
carlzhc committed Jan 16, 2024
1 parent 5b132a2 commit f281208
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
string (REPLACE ";" " " LIBBSD_FLAGS "${BSD_CFLAGS}")
target_link_libraries (mg ${BSD_LIBRARIES})
set (CMAKE_C_FLAGS "-Wall -DREGEX -D_GNU_SOURCE ${LIBBSD_FLAGS} ${NCURSES_FLAGS} -L${NCURSES_LIBRARY_DIRS}")
elseif(CMAKE_SYSTEM_NAME MATCHES "MSYS")
pkg_check_modules (BSD REQUIRED libbsd-overlay)
link_directories (${BSD_LIBRARY_DIRS})
string (REPLACE ";" " " LIBBSD_FLAGS "${BSD_CFLAGS}")
target_link_libraries (mg ${BSD_LIBRARIES})
set (CMAKE_C_FLAGS "-Wall -DREGEX -isystem /usr/include -D_GNU_SOURCE ${LIBBSD_FLAGS} ${NCURSES_FLAGS}")
else()
set (CMAKE_C_FLAGS "-Wall -DREGEX ${LIBBSD_FLAGS} ${NCURSES_FLAGS} -L${NCURSES_LIBRARY_DIRS}")
endif()
3 changes: 3 additions & 0 deletions ttyio.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#include <sys/queue.h>
#include <sys/time.h>
#include <sys/types.h>
#if defined(__MSYS__)
#include <sys/socket.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
Expand Down

0 comments on commit f281208

Please sign in to comment.