lizzie
5 months ago
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
3 changed files with
10 additions and
4 deletions
-
CMakeLists.txt
-
src/core/CMakeLists.txt
-
src/core/internal_network/wifi_scanner.cpp
|
|
|
@ -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) |
|
|
|
|
|
|
|
option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) |
|
|
|
option(ENABLE_WIFI_SCAN "Enable WiFi scanning" OFF) |
|
|
|
|
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") |
|
|
|
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" OFF) |
|
|
|
|
|
|
|
@ -1150,8 +1150,9 @@ add_library(core STATIC |
|
|
|
tools/renderdoc.h |
|
|
|
) |
|
|
|
|
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
|
|
|
if (ENABLE_WIFI_SCAN) |
|
|
|
# find_package(libiw REQUIRED) |
|
|
|
target_compile_definitions(core PRIVATE -DENABLE_WIFI_SCAN) |
|
|
|
target_link_libraries(core PRIVATE iw) |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
@ -19,7 +19,7 @@ using namespace std::chrono_literals; |
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace Network { |
|
|
|
|
|
|
|
#ifdef ENABLE_WIFI_SCAN
|
|
|
|
#ifdef _WIN32
|
|
|
|
static u8 QualityToPercent(DWORD q) { |
|
|
|
return static_cast<u8>(q); |
|
|
|
@ -173,16 +173,20 @@ static std::vector<Network::ScanData> ScanWifiLinux(std::chrono::milliseconds de |
|
|
|
return out; |
|
|
|
} |
|
|
|
#endif /* linux */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
std::vector<Network::ScanData> ScanWifiNetworks(std::chrono::milliseconds deadline) { |
|
|
|
#ifdef _WIN32
|
|
|
|
#ifdef ENABLE_WIFI_SCAN
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return ScanWifiWin(deadline); |
|
|
|
#elif defined(__linux__) && !defined(ANDROID)
|
|
|
|
return ScanWifiLinux(deadline); |
|
|
|
#else
|
|
|
|
std::this_thread::sleep_for(deadline); |
|
|
|
return {}; // unsupported host, pretend no results
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
return {}; // disabled, pretend no results
|
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
} // namespace Network
|