]> prime8.dev >> repos - ttyd.git/commitdiff
cmake: fix compile on macOS
authorShuanglei Tao <tsl0922@gmail.com>
Sat, 16 Mar 2019 03:17:36 +0000 (11:17 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Sat, 16 Mar 2019 03:17:36 +0000 (11:17 +0800)
CMakeLists.txt

index bba1f7e2e7d5250b0595cf8a532a979b1d10a9fe..2381e8e0fededb74cc14916832652883edef2beb 100644 (file)
@@ -69,7 +69,12 @@ list(APPEND SOURCE_FILES html.h)
 set(INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR} ${LIBWEBSOCKETS_INCLUDE_DIR} ${JSON-C_INCLUDE_DIR})
 set(LINK_LIBS pthread ${OPENSSL_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} ${JSON-C_LIBRARY})
 
-if(NOT APPLE)
+if(APPLE)
+    # required for the new homebrew version of libwebsockets
+    find_path(LIBUV_INCLUDE_DIR NAMES uv.h)
+    find_path(LIBEVENT_INCLUDE_DIR NAMES event2/event.h)
+    list(APPEND INCLUDE_DIRS ${LIBUV_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR})
+else()
     list(APPEND LINK_LIBS util)
 endif()