Fixed DLL compilation on Windows for CMake. 94/3094/1
authorJoakim Soderberg <joakim.soderberg@gmail.com>
Wed, 13 Feb 2013 01:29:26 +0000 (09:29 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:35 +0000 (13:01 -0800)
commit2e16c817f5a3b933be2bab40545487b942200df2
tree99748c19979dc4ec721da7f23069c5812e8acf35
parent0af32b80411ef4646868f6d5c750c64c96feb7cc
Fixed DLL compilation on Windows for CMake.

- Define LWS_DLL and LWS_INTERNAL when websockets_shared is compiled.

- The websocket_shared target compiles to websocket.lib / websocket.dll
  (websocket.lib contains the exported functions for websocket.dll, and is
  the file that is linked to when a program wants to use the dll)

- The websocket target compiles to websocket_static.lib on windows.

- Replaced any "extern" with "LWS_EXTERN" on libwebsockets.h for proper
  DLL function exports.

- Created a LIB_LIST with all the libwebsocket dependencies, instead of
  multiple calls to target_link_libraries, only one call is made for both
  the static and shared library version. This makes it easy to add other
  variants if wanted in the future.

- Added ZLIB as a dependency for the libs, so that the build order will be
  correct at all times.

- Added a dependency for the websockets lib to the test apps, so it is
  built before them.

- Fixed the test-server-extpoll app to include the emulated_poll, and link
  to winsock on Windows.

- Removed the global export of libwebsocket_internal_extensions, and added
  a function libwebsocket_get_internal_extensions() that returns it
  instead. Using the global would not work with the DLL export on Windows.
CMakeLists.txt
lib/extension.c
lib/libwebsockets.h
lib/private-libwebsockets.h
test-server/test-client.c
test-server/test-fraggle.c
test-server/test-ping.c
test-server/test-server.c