1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

Added some minor changes to CMake build file.

- Added options for compiling without server/client parts.
- Fixed a syntax error on printing an error on CyaSSL compilation.
- Don't compile server-extpoll either when the server isn't compiled.
This commit is contained in:
Joakim Soderberg 2013-02-06 15:29:59 +09:00 committed by Andy Green
parent b378ce9d18
commit e9a42119f6
2 changed files with 21 additions and 9 deletions

View file

@ -60,7 +60,7 @@ set(CYASSL_INCLUDE_DIRS CACHE STRING "")
if (USE_CYASSL)
if ("${CYASSL_LIB}" STREQUAL "" OR "${CYASSL_INCLUDE_DIRS}" STREQUAL "")
error("You must set CYASSL_LIB and CYASSL_INCLUDE_DIRS when USE_CYASSL is turned on")
message(FATAL_ERROR "You must set CYASSL_LIB and CYASSL_INCLUDE_DIRS when USE_CYASSL is turned on")
endif()
endif()
@ -80,6 +80,14 @@ if (WITHOUT_DAEMONIZE)
set(LWS_NO_DAEMONIZE 1)
endif()
if (WITHOUT_SERVER)
set(LWS_NO_SERVER 1)
endif()
if (WITHOUT_CLIENT)
set(LWS_NO_CLIENT 1)
endif()
if (MINGW)
set(LWS_MINGW_SUPPORT 1)
endif()
@ -380,8 +388,6 @@ if (NOT WITHOUT_TESTAPPS)
TARGET ${TEST_NAME}
PROPERTY COMPILE_DEFINITIONS INSTALL_DATADIR="${SSL_CERT_DIR}"
)
endfunction()
#
@ -392,7 +398,7 @@ if (NOT WITHOUT_TESTAPPS)
"test-server/test-client.c"
""
"")
endif(NOT WITHOUT_CLIENT)
endif()
#
# test-server
@ -402,12 +408,12 @@ if (NOT WITHOUT_TESTAPPS)
"test-server/test-server.c"
""
"${WIN32_HELPERS_PATH}/netdb.h;${WIN32_HELPERS_PATH}/strings.h;${WIN32_HELPERS_PATH}/unistd.h;${WIN32_HELPERS_PATH}/websock-w32.h")
endif(NOT WITHOUT_SERVER)
endif()
#
# test-server-extpoll
#
if (NOT WITHOUT_SERVER_EXTPOLL)
if (NOT WITHOUT_SERVER AND NOT WITHOUT_SERVER_EXTPOLL)
create_test_app(test-server-extpoll
"test-server/test-server.c"
""
@ -418,7 +424,7 @@ if (NOT WITHOUT_TESTAPPS)
TARGET test-server-extpoll
PROPERTY COMPILE_DEFINITIONS EXTERNAL_POLL INSTALL_DATADIR="${SSL_CERT_DIR}"
)
endif(NOT WITHOUT_SERVER_EXTPOLL)
endif()
#
# test-fraggle
@ -428,7 +434,7 @@ if (NOT WITHOUT_TESTAPPS)
"test-server/test-fraggle.c"
""
"${WIN32_HELPERS_PATH}/unistd.h;${WIN32_HELPERS_PATH}/sys/time.h")
endif(NOT WITHOUT_FRAGGLE)
endif()
#
# test-ping
@ -438,7 +444,7 @@ if (NOT WITHOUT_TESTAPPS)
"test-server/test-ping.c"
""
"${WIN32_HELPERS_PATH}/unistd.h;${WIN32_HELPERS_PATH}/sys/time.h")
endif(NOT WITHOUT_PING)
endif()
#
# Copy OpenSSL dlls to the output directory on Windows.

View file

@ -25,6 +25,12 @@
/* Don't build the daemonizeation api */
#cmakedefine LWS_NO_DAEMONIZE
/* Build without server support */
#cmakedefine LWS_NO_SERVER
/* Build without client support */
#cmakedefine LWS_NO_CLIENT
/* If we should compile with MinGW support */
#cmakedefine LWS_MINGW_SUPPORT