"lib-examples" built when "LIBUV_FOUND" is false against libh2o-evloop
@@ -469,24 +469,45 @@ IF (WSLAY_FOUND)
ENDIF (WSLAY_FOUND)
ADD_EXECUTABLE(examples-http1client examples/libh2o/http1client.c)
+ADD_EXECUTABLE(examples-socket-client examples/libh2o/socket-client.c)
+ADD_EXECUTABLE(examples-simple examples/libh2o/simple.c)
+ADD_EXECUTABLE(examples-websocket lib/websocket.c examples/libh2o/websocket.c)
+
+IF (LIBUV_FOUND)
SET_TARGET_PROPERTIES(examples-http1client PROPERTIES
EXCLUDE_FROM_ALL 1)
TARGET_LINK_LIBRARIES(examples-http1client libh2o ${LIBUV_LIBRARIES} ${EXTRA_LIBS})
-
-ADD_EXECUTABLE(examples-socket-client examples/libh2o/socket-client.c)
SET_TARGET_PROPERTIES(examples-socket-client PROPERTIES
EXCLUDE_FROM_ALL 1)
TARGET_LINK_LIBRARIES(examples-socket-client libh2o ${LIBUV_LIBRARIES} ${EXTRA_LIBS})
-ADD_EXECUTABLE(examples-simple examples/libh2o/simple.c)
SET_TARGET_PROPERTIES(examples-simple PROPERTIES
EXCLUDE_FROM_ALL 1)
TARGET_LINK_LIBRARIES(examples-simple libh2o ${LIBUV_LIBRARIES} ${EXTRA_LIBS})
-ADD_EXECUTABLE(examples-websocket lib/websocket.c examples/libh2o/websocket.c)
SET_TARGET_PROPERTIES(examples-websocket PROPERTIES
EXCLUDE_FROM_ALL 1)
TARGET_LINK_LIBRARIES(examples-websocket libh2o ${LIBUV_LIBRARIES} ${WSLAY_LIBRARIES} ${EXTRA_LIBS})
+ELSE ()
+SET_TARGET_PROPERTIES(examples-http1client PROPERTIES
+ COMPILE_FLAGS "-DH2O_USE_LIBUV=0"
+ EXCLUDE_FROM_ALL 1)
+TARGET_LINK_LIBRARIES(examples-http1client libh2o-evloop ${EXTRA_LIBS})
+SET_TARGET_PROPERTIES(examples-socket-client PROPERTIES
+ COMPILE_FLAGS "-DH2O_USE_LIBUV=0"
+ EXCLUDE_FROM_ALL 1)
+TARGET_LINK_LIBRARIES(examples-socket-client libh2o-evloop ${EXTRA_LIBS})
+
+SET_TARGET_PROPERTIES(examples-simple PROPERTIES
+ COMPILE_FLAGS "-DH2O_USE_LIBUV=0"
+ EXCLUDE_FROM_ALL 1)
+TARGET_LINK_LIBRARIES(examples-simple libh2o-evloop ${EXTRA_LIBS})
+
+SET_TARGET_PROPERTIES(examples-websocket PROPERTIES
+ COMPILE_FLAGS "-DH2O_USE_LIBUV=0"
+ EXCLUDE_FROM_ALL 1)
+TARGET_LINK_LIBRARIES(examples-websocket libh2o-evloop ${WSLAY_LIBRARIES} ${EXTRA_LIBS})
+ENDIF ()
ADD_EXECUTABLE(examples-latency-optimization examples/libh2o/latency-optimization.c)
SET_TARGET_PROPERTIES(examples-latency-optimization PROPERTIES
