tdweb: do not link with libssl, only with libcrypto
GitOrigin-RevId: fb7cd454c3b368381fd65150979e6233a452eb8c
This commit is contained in:
parent
fe00a7e7cf
commit
d22a6751db
@ -15,6 +15,7 @@ cd openssl-$OPENSSL
|
|||||||
emconfigure ./Configure linux-generic32 no-shared no-dso no-engine no-unit-test no-ui || exit 1
|
emconfigure ./Configure linux-generic32 no-shared no-dso no-engine no-unit-test no-ui || exit 1
|
||||||
sed -i.bak 's/CROSS_COMPILE=.*/CROSS_COMPILE=/g' Makefile || exit 1
|
sed -i.bak 's/CROSS_COMPILE=.*/CROSS_COMPILE=/g' Makefile || exit 1
|
||||||
sed -i.bak 's/-ldl //g' Makefile || exit 1
|
sed -i.bak 's/-ldl //g' Makefile || exit 1
|
||||||
|
sed -i.bak 's/-O3/-Os/g' Makefile || exit 1
|
||||||
echo "Building OpenSSL..."
|
echo "Building OpenSSL..."
|
||||||
emmake make depend || exit 1
|
emmake make depend || exit 1
|
||||||
emmake make -j 4 || exit 1
|
emmake make -j 4 || exit 1
|
||||||
|
@ -48,7 +48,11 @@ set(TDNET_SOURCE
|
|||||||
add_library(tdnet STATIC ${TDNET_SOURCE})
|
add_library(tdnet STATIC ${TDNET_SOURCE})
|
||||||
target_include_directories(tdnet PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
target_include_directories(tdnet PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
target_include_directories(tdnet SYSTEM PRIVATE $<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>)
|
target_include_directories(tdnet SYSTEM PRIVATE $<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>)
|
||||||
target_link_libraries(tdnet PUBLIC tdutils tdactor PRIVATE ${CMAKE_DL_LIBS} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
|
target_link_libraries(tdnet PUBLIC tdutils tdactor PRIVATE ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES})
|
||||||
|
target_link_libraries(tdnet PRIVATE ${OPENSSL_CRYPTO_LIBRARY})
|
||||||
|
if (NOT EMSCRIPTEN)
|
||||||
|
target_link_libraries(tdnet PRIVATE ${OPENSSL_SSL_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(tdnet PRIVATE Crypt32)
|
target_link_libraries(tdnet PRIVATE Crypt32)
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
//
|
//
|
||||||
#include "td/net/SslStream.h"
|
#include "td/net/SslStream.h"
|
||||||
|
|
||||||
|
#if !TD_EMSCRIPTEN
|
||||||
#include "td/utils/common.h"
|
#include "td/utils/common.h"
|
||||||
#include "td/utils/logging.h"
|
#include "td/utils/logging.h"
|
||||||
#include "td/utils/misc.h"
|
#include "td/utils/misc.h"
|
||||||
@ -541,3 +542,34 @@ size_t SslStream::flow_write(Slice slice) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace td
|
} // namespace td
|
||||||
|
#else
|
||||||
|
namespace td {
|
||||||
|
namespace detail {
|
||||||
|
class SslStreamImpl {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
SslStream::SslStream() = default;
|
||||||
|
SslStream::SslStream(SslStream &&) = default;
|
||||||
|
SslStream &SslStream::operator=(SslStream &&) = default;
|
||||||
|
SslStream::~SslStream() = default;
|
||||||
|
|
||||||
|
Result<SslStream> SslStream::create(CSlice host, CSlice cert_file, VerifyPeer verify_peer) {
|
||||||
|
return Status::Error("Not supported in emscripten");
|
||||||
|
}
|
||||||
|
SslStream::SslStream(unique_ptr<detail::SslStreamImpl> impl) : impl_(std::move(impl)) {
|
||||||
|
}
|
||||||
|
ByteFlowInterface &SslStream::read_byte_flow() {
|
||||||
|
UNREACHABLE();
|
||||||
|
}
|
||||||
|
ByteFlowInterface &SslStream::write_byte_flow() {
|
||||||
|
UNREACHABLE();
|
||||||
|
}
|
||||||
|
size_t SslStream::flow_read(MutableSlice slice) {
|
||||||
|
UNREACHABLE();
|
||||||
|
}
|
||||||
|
size_t SslStream::flow_write(Slice slice) {
|
||||||
|
UNREACHABLE();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace td
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user