Make lib-network-manager an opt-in library

This commit is contained in:
Dmitry Vedenko 2021-05-26 16:35:12 +03:00 committed by Dmitry Vedenko
parent fdd20452ea
commit 4dc4e86863
7 changed files with 38 additions and 17 deletions

View File

@ -112,7 +112,8 @@ jobs:
-B build \ -B build \
-G "${{matrix.config.generator}}" \ -G "${{matrix.config.generator}}" \
-A ${{matrix.config.platform}} \ -A ${{matrix.config.platform}} \
-D audacity_use_pch=no -D audacity_use_pch=no \
-D audacity_has_networking=yes
# Build Audacity # Build Audacity
cmake --build build --config Release --verbose cmake --build build --config Release --verbose
@ -150,7 +151,8 @@ jobs:
-B build \ -B build \
-T buildsystem=1 \ -T buildsystem=1 \
-G "${{matrix.config.generator}}" \ -G "${{matrix.config.generator}}" \
-D audacity_use_pch=no -D audacity_use_pch=no \
-D audacity_has_networking=yes
# Build Audacity # Build Audacity
cmake --build build --config Release cmake --build build --config Release
@ -189,7 +191,8 @@ jobs:
cmake -S . \ cmake -S . \
-B build \ -B build \
-G "${{matrix.config.generator}}" \ -G "${{matrix.config.generator}}" \
-D audacity_use_pch=no -D audacity_use_pch=no \
-D audacity_has_networking=yes
# Build Audacity # Build Audacity
cmake --build build --config Release cmake --build build --config Release

View File

@ -149,6 +149,10 @@ cmd_option( ${_OPT}obey_system_dependencies
Off Off
) )
cmd_option( ${_OPT}has_networking
"Build networking features into Audacity"
Off)
include( AudacityDependencies ) include( AudacityDependencies )
# Pull all the modules we'll need # Pull all the modules we'll need

View File

@ -104,18 +104,22 @@ add_conan_lib(
ALWAYS_ALLOW_CONAN_FALLBACK ALWAYS_ALLOW_CONAN_FALLBACK
) )
add_conan_lib( if( ${_OPT}has_networking )
CURL
libcurl/7.75.0 add_conan_lib(
REQUIRED CURL
OPTION_NAME curl libcurl/7.75.0
PKG_CONFIG "libcurl >= 7.68.0" REQUIRED
INTERFACE_NAME CURL::libcurl OPTION_NAME curl
FIND_PACKAGE_OPTIONS PKG_CONFIG "libcurl >= 7.68.0"
CONAN_OPTIONS INTERFACE_NAME CURL::libcurl
libcurl:with_ssl=${curl_ssl} FIND_PACKAGE_OPTIONS
libcurl:shared=True CONAN_OPTIONS
) libcurl:with_ssl=${curl_ssl}
libcurl:shared=True
)
endif()
set_conan_vars_to_parent() set_conan_vars_to_parent()

View File

@ -4,9 +4,12 @@
# that it depends on # that it depends on
set( LIBRARIES set( LIBRARIES
"lib-string-utils" "lib-string-utils"
"lib-network-manager"
) )
if ( ${_OPT}has_networking )
list( APPEND LIBRARIES "lib-network-manager")
endif()
foreach( LIBRARY ${LIBRARIES} ) foreach( LIBRARY ${LIBRARIES} )
add_subdirectory( "${LIBRARY}" ) add_subdirectory( "${LIBRARY}" )
endforeach() endforeach()

View File

@ -37,5 +37,7 @@ set ( LIBRARIES PRIVATE
wxwidgets::base wxwidgets::base
) )
set ( DEFINES INTERFACE "HAS_NETWORKING" )
audacity_library( ${TARGET} "${SOURCES}" "${LIBRARIES}" "" "" )
audacity_library( ${TARGET} "${SOURCES}" "${LIBRARIES}" "${DEFINES}" "" )

View File

@ -38,6 +38,7 @@ cmake_options=(
-Daudacity_use_sbsms=local # We prefer using the latest version of sbsms -Daudacity_use_sbsms=local # We prefer using the latest version of sbsms
-Daudacity_use_soundtouch=system -Daudacity_use_soundtouch=system
-Daudacity_use_twolame=system -Daudacity_use_twolame=system
-Daudacity_has_networking=yes
-Daudacity_use_curl=system -Daudacity_use_curl=system
) )

View File

@ -112,7 +112,9 @@ It handles initialization and termination by subclassing wxApp.
#include "widgets/FileConfig.h" #include "widgets/FileConfig.h"
#include "widgets/FileHistory.h" #include "widgets/FileHistory.h"
#ifdef HAS_NETWORKING
#include "NetworkManager.h" #include "NetworkManager.h"
#endif
#ifdef EXPERIMENTAL_EASY_CHANGE_KEY_BINDINGS #ifdef EXPERIMENTAL_EASY_CHANGE_KEY_BINDINGS
#include "prefs/KeyConfigPrefs.h" #include "prefs/KeyConfigPrefs.h"
@ -2202,7 +2204,9 @@ int AudacityApp::OnExit()
// Terminate the PluginManager (must be done before deleting the locale) // Terminate the PluginManager (must be done before deleting the locale)
PluginManager::Get().Terminate(); PluginManager::Get().Terminate();
#ifdef HAS_NETWORKING
audacity::network_manager::NetworkManager::GetInstance().Terminate(); audacity::network_manager::NetworkManager::GetInstance().Terminate();
#endif
return 0; return 0;
} }