Fix Windows CI with appveyor (#110)
Fix windows CI with appveyor + minor tweaks.
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							260a94d3b0
						
					
				
				
					commit
					ae3856c10f
				
			@@ -115,10 +115,7 @@ endif()
 | 
			
		||||
 | 
			
		||||
set(USE_OPEN_SSL FALSE)
 | 
			
		||||
if (USE_TLS)
 | 
			
		||||
    add_definitions(-DIXWEBSOCKET_USE_TLS)
 | 
			
		||||
 | 
			
		||||
    if (USE_MBED_TLS)
 | 
			
		||||
        add_definitions(-DIXWEBSOCKET_USE_MBED_TLS)
 | 
			
		||||
        list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketMbedTLS.h)
 | 
			
		||||
        list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketMbedTLS.cpp)
 | 
			
		||||
    elseif (APPLE)
 | 
			
		||||
@@ -128,7 +125,6 @@ if (USE_TLS)
 | 
			
		||||
        list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketSChannel.h)
 | 
			
		||||
        list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketSChannel.cpp)
 | 
			
		||||
    else()
 | 
			
		||||
        add_definitions(-DIXWEBSOCKET_USE_OPEN_SSL)
 | 
			
		||||
        set(USE_OPEN_SSL TRUE)
 | 
			
		||||
        list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketOpenSSL.h)
 | 
			
		||||
        list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketOpenSSL.cpp)
 | 
			
		||||
@@ -140,6 +136,17 @@ add_library( ixwebsocket STATIC
 | 
			
		||||
    ${IXWEBSOCKET_HEADERS}
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
if (USE_TLS)
 | 
			
		||||
    target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_TLS)
 | 
			
		||||
    if (USE_MBED_TLS)
 | 
			
		||||
        target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_MBED_TLS)
 | 
			
		||||
    elseif (APPLE)
 | 
			
		||||
    elseif (WIN32)
 | 
			
		||||
    else()
 | 
			
		||||
        target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_OPEN_SSL)
 | 
			
		||||
    endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (APPLE AND USE_TLS AND NOT USE_MBED_TLS)
 | 
			
		||||
  target_link_libraries(ixwebsocket "-framework foundation" "-framework security")
 | 
			
		||||
endif()
 | 
			
		||||
@@ -171,7 +178,7 @@ if (USE_TLS AND USE_MBED_TLS)
 | 
			
		||||
    target_link_libraries(ixwebsocket mbedtls)
 | 
			
		||||
  else()
 | 
			
		||||
    find_package(MbedTLS REQUIRED)
 | 
			
		||||
    include_directories(${MBEDTLS_INCLUDE_DIRS})
 | 
			
		||||
    target_include_directories(ixwebsocket PUBLIC ${MBEDTLS_INCLUDE_DIRS})
 | 
			
		||||
    target_link_libraries(ixwebsocket ${MBEDTLS_LIBRARIES})
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								appveyor.yml
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								appveyor.yml
									
									
									
									
									
								
							@@ -2,13 +2,21 @@ image:
 | 
			
		||||
- Visual Studio 2017
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
- ls -al
 | 
			
		||||
- cd C:\Tools\vcpkg
 | 
			
		||||
- git pull
 | 
			
		||||
- .\bootstrap-vcpkg.bat
 | 
			
		||||
- cd %APPVEYOR_BUILD_FOLDER%
 | 
			
		||||
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
 | 
			
		||||
- vcpkg install zlib:x64-windows
 | 
			
		||||
- vcpkg install mbedtls:x64-windows
 | 
			
		||||
- cd test
 | 
			
		||||
- mkdir build
 | 
			
		||||
- cd build
 | 
			
		||||
- cmake -G"NMake Makefiles" ..
 | 
			
		||||
- cmake -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DUSE_TLS=1 -G"NMake Makefiles" ..
 | 
			
		||||
- nmake
 | 
			
		||||
- ixwebsocket_unittest.exe
 | 
			
		||||
- cd ..
 | 
			
		||||
- build\ixwebsocket_unittest.exe
 | 
			
		||||
 | 
			
		||||
cache: c:\tools\vcpkg\installed\
 | 
			
		||||
 | 
			
		||||
build: off
 | 
			
		||||
 
 | 
			
		||||
@@ -21,6 +21,8 @@ Options for building:
 | 
			
		||||
* `-DUSE_MBED_TLS=1` will use [mbedlts](https://tls.mbed.org/) for the TLS support (default on Windows)
 | 
			
		||||
* `-DUSE_WS=1` will build the ws interactive command line tool
 | 
			
		||||
 | 
			
		||||
If you are on Windows, look at the [appveyor](https://github.com/machinezone/IXWebSocket/blob/master/appveyor.yml) file that has instructions for building dependencies.
 | 
			
		||||
 | 
			
		||||
### vcpkg
 | 
			
		||||
 | 
			
		||||
It is possible to get IXWebSocket through Microsoft [vcpkg](https://github.com/microsoft/vcpkg).
 | 
			
		||||
 
 | 
			
		||||
@@ -62,8 +62,6 @@ set (SOURCES
 | 
			
		||||
  IXHttpClientTest.cpp
 | 
			
		||||
  IXHttpServerTest.cpp
 | 
			
		||||
  IXUnityBuildsTest.cpp
 | 
			
		||||
  IXCobraChatTest.cpp
 | 
			
		||||
  IXCobraMetricsPublisherTest.cpp
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Some unittest don't work on windows yet
 | 
			
		||||
@@ -72,6 +70,8 @@ if (UNIX)
 | 
			
		||||
    IXDNSLookupTest.cpp
 | 
			
		||||
    cmd_websocket_chat.cpp
 | 
			
		||||
    IXWebSocketCloseTest.cpp
 | 
			
		||||
    IXCobraChatTest.cpp
 | 
			
		||||
    IXCobraMetricsPublisherTest.cpp
 | 
			
		||||
  )
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@
 | 
			
		||||
 | 
			
		||||
#include <functional>
 | 
			
		||||
#include <memory>
 | 
			
		||||
#include <atomic>
 | 
			
		||||
 | 
			
		||||
namespace ix
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user