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

View File

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

View File

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

View File

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

View File

@ -37,5 +37,7 @@ set ( LIBRARIES PRIVATE
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_soundtouch=system
-Daudacity_use_twolame=system
-Daudacity_has_networking=yes
-Daudacity_use_curl=system
)

View File

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