Use Threads::Threads target (#349)
This commit is contained in:
		@@ -210,7 +210,7 @@ if (USE_TLS)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    add_definitions(${OPENSSL_DEFINITIONS})
 | 
					    add_definitions(${OPENSSL_DEFINITIONS})
 | 
				
			||||||
    target_include_directories(ixwebsocket PUBLIC $<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>)
 | 
					    target_include_directories(ixwebsocket PUBLIC $<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>)
 | 
				
			||||||
    target_link_libraries(ixwebsocket ${OPENSSL_LIBRARIES})
 | 
					    target_link_libraries(ixwebsocket PRIVATE ${OPENSSL_LIBRARIES})
 | 
				
			||||||
  elseif (USE_MBED_TLS)
 | 
					  elseif (USE_MBED_TLS)
 | 
				
			||||||
    message(STATUS "TLS configured to use mbedtls")
 | 
					    message(STATUS "TLS configured to use mbedtls")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -224,10 +224,10 @@ if (USE_TLS)
 | 
				
			|||||||
      
 | 
					      
 | 
				
			||||||
    endif()
 | 
					    endif()
 | 
				
			||||||
    target_include_directories(ixwebsocket PUBLIC $<BUILD_INTERFACE:${MBEDTLS_INCLUDE_DIRS}>)
 | 
					    target_include_directories(ixwebsocket PUBLIC $<BUILD_INTERFACE:${MBEDTLS_INCLUDE_DIRS}>)
 | 
				
			||||||
    target_link_libraries(ixwebsocket ${MBEDTLS_LIBRARIES})
 | 
					    target_link_libraries(ixwebsocket PRIVATE ${MBEDTLS_LIBRARIES})
 | 
				
			||||||
  elseif (USE_SECURE_TRANSPORT)
 | 
					  elseif (USE_SECURE_TRANSPORT)
 | 
				
			||||||
    message(STATUS "TLS configured to use secure transport")
 | 
					    message(STATUS "TLS configured to use secure transport")
 | 
				
			||||||
    target_link_libraries(ixwebsocket "-framework Foundation" "-framework Security")
 | 
					    target_link_libraries(ixwebsocket PRIVATE "-framework Foundation" "-framework Security")
 | 
				
			||||||
  endif()
 | 
					  endif()
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -239,7 +239,7 @@ if (USE_ZLIB)
 | 
				
			|||||||
    find_package(ZLIB REQUIRED)
 | 
					    find_package(ZLIB REQUIRED)
 | 
				
			||||||
  endif()
 | 
					  endif()
 | 
				
			||||||
  target_include_directories(ixwebsocket PUBLIC $<BUILD_INTERFACE:${ZLIB_INCLUDE_DIRS}>)
 | 
					  target_include_directories(ixwebsocket PUBLIC $<BUILD_INTERFACE:${ZLIB_INCLUDE_DIRS}>)
 | 
				
			||||||
  target_link_libraries(ixwebsocket ${ZLIB_LIBRARIES})
 | 
					  target_link_libraries(ixwebsocket PRIVATE ZLIB::ZLIB)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_ZLIB)
 | 
					  target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_ZLIB)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
@@ -248,22 +248,23 @@ endif()
 | 
				
			|||||||
find_package(Deflate)
 | 
					find_package(Deflate)
 | 
				
			||||||
if (DEFLATE_FOUND)
 | 
					if (DEFLATE_FOUND)
 | 
				
			||||||
  include_directories(${DEFLATE_INCLUDE_DIRS})
 | 
					  include_directories(${DEFLATE_INCLUDE_DIRS})
 | 
				
			||||||
  target_link_libraries(ixwebsocket ${DEFLATE_LIBRARIES})
 | 
					  target_link_libraries(ixwebsocket PRIVATE ${DEFLATE_LIBRARIES})
 | 
				
			||||||
  target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_DEFLATE)
 | 
					  target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_DEFLATE)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (WIN32)
 | 
					if (WIN32)
 | 
				
			||||||
  target_link_libraries(ixwebsocket wsock32 ws2_32 shlwapi)
 | 
					  target_link_libraries(ixwebsocket PRIVATE wsock32 ws2_32 shlwapi)
 | 
				
			||||||
  add_definitions(-D_CRT_SECURE_NO_WARNINGS)
 | 
					  target_compile_definitions(ixwebsocket PRIVATE _CRT_SECURE_NO_WARNINGS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (USE_TLS)
 | 
					  if (USE_TLS)
 | 
				
			||||||
    target_link_libraries(ixwebsocket Crypt32)
 | 
					    target_link_libraries(ixwebsocket PRIVATE Crypt32)
 | 
				
			||||||
  endif()
 | 
					  endif()
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (UNIX)
 | 
					if (UNIX)
 | 
				
			||||||
 | 
					  set(THREADS_PREFER_PTHREAD_FLAG TRUE)
 | 
				
			||||||
  find_package(Threads)
 | 
					  find_package(Threads)
 | 
				
			||||||
  target_link_libraries(ixwebsocket ${CMAKE_THREAD_LIBS_INIT})
 | 
					  target_link_libraries(ixwebsocket PRIVATE Threads::Threads)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user