Skip to content

Commit

Permalink
refactor: remove obsolete lightweight build option
Browse files Browse the repository at this point in the history
  • Loading branch information
ckerr committed Jan 1, 2023
1 parent 453836f commit d2ed80d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ tr_auto_option(ENABLE_MAC "Build Mac client" AUTO)
option(ENABLE_UTILS "Build utils (create, edit, show)" ON)
option(ENABLE_CLI "Build command-line client" OFF)
option(ENABLE_TESTS "Build unit tests" ON)
option(ENABLE_LIGHTWEIGHT "Optimize libtransmission for low-resource systems: smaller cache size, prefer unencrypted peer connections, etc." OFF)
option(ENABLE_UTP "Build µTP support" ON)
option(ENABLE_WERROR "Treat warnings as errors" OFF)
option(ENABLE_NLS "Enable native language support" ON)
Expand Down
4 changes: 0 additions & 4 deletions libtransmission/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@ add_definitions(
${MINIUPNPC_DEFINITIONS}
)

if(ENABLE_LIGHTWEIGHT)
add_definitions(-DTR_LIGHTWEIGHT)
endif()

if(NOT ENABLE_NLS)
add_definitions(-DDISABLE_GETTEXT)
endif()
Expand Down
8 changes: 1 addition & 7 deletions libtransmission/crypto-utils-openssl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ static void log_openssl_error(char const* file, int line)

if (tr_logLevelIsActive(TR_LOG_ERROR))
{
#ifndef TR_LIGHTWEIGHT

static bool strings_loaded = false;

if (!strings_loaded)
if (static bool strings_loaded = false; !strings_loaded)
{
#if OPENSSL_VERSION_NUMBER < 0x10100000 || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000)
ERR_load_crypto_strings();
Expand All @@ -52,8 +48,6 @@ static void log_openssl_error(char const* file, int line)
strings_loaded = true;
}

#endif

auto buf = std::array<char, 512>{};
ERR_error_string_n(error_code, std::data(buf), std::size(buf));
tr_logAddMessage(
Expand Down
2 changes: 1 addition & 1 deletion libtransmission/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct tr_error;

/* #define DISABLE_GETTEXT */
#ifndef DISABLE_GETTEXT
#if defined(_WIN32) || defined(TR_LIGHTWEIGHT)
#if defined(_WIN32)
#define DISABLE_GETTEXT
#endif
#endif
Expand Down

0 comments on commit d2ed80d

Please sign in to comment.