[wifi] conditionally enable (#90)
Reviewed-on: #90 Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
275d64e653
commit
fb459c75d9
3 changed files with 10 additions and 4 deletions
|
@ -50,6 +50,7 @@ option(ENABLE_QT_UPDATE_CHECKER "Enable update checker for the Qt frontend" OFF)
|
||||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF)
|
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF)
|
||||||
|
|
||||||
option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
|
option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
|
||||||
|
option(ENABLE_WIFI_SCAN "Enable WiFi scanning" OFF)
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||||
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" OFF)
|
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" OFF)
|
||||||
|
|
|
@ -1150,8 +1150,9 @@ add_library(core STATIC
|
||||||
tools/renderdoc.h
|
tools/renderdoc.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
if (ENABLE_WIFI_SCAN)
|
||||||
# find_package(libiw REQUIRED)
|
# find_package(libiw REQUIRED)
|
||||||
|
target_compile_definitions(core PRIVATE -DENABLE_WIFI_SCAN)
|
||||||
target_link_libraries(core PRIVATE iw)
|
target_link_libraries(core PRIVATE iw)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ using namespace std::chrono_literals;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Network {
|
namespace Network {
|
||||||
|
#ifdef ENABLE_WIFI_SCAN
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static u8 QualityToPercent(DWORD q) {
|
static u8 QualityToPercent(DWORD q) {
|
||||||
return static_cast<u8>(q);
|
return static_cast<u8>(q);
|
||||||
|
@ -173,16 +173,20 @@ static std::vector<Network::ScanData> ScanWifiLinux(std::chrono::milliseconds de
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
#endif /* linux */
|
#endif /* linux */
|
||||||
|
#endif
|
||||||
|
|
||||||
std::vector<Network::ScanData> ScanWifiNetworks(std::chrono::milliseconds deadline) {
|
std::vector<Network::ScanData> ScanWifiNetworks(std::chrono::milliseconds deadline) {
|
||||||
#ifdef _WIN32
|
#ifdef ENABLE_WIFI_SCAN
|
||||||
|
#if defined(_WIN32)
|
||||||
return ScanWifiWin(deadline);
|
return ScanWifiWin(deadline);
|
||||||
#elif defined(__linux__) && !defined(ANDROID)
|
#elif defined(__linux__) && !defined(ANDROID)
|
||||||
return ScanWifiLinux(deadline);
|
return ScanWifiLinux(deadline);
|
||||||
#else
|
#else
|
||||||
std::this_thread::sleep_for(deadline);
|
|
||||||
return {}; // unsupported host, pretend no results
|
return {}; // unsupported host, pretend no results
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
return {}; // disabled, pretend no results
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Network
|
} // namespace Network
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue