Simplify winrt build target.

PiperOrigin-RevId: 672754586
This commit is contained in:
Francis Tsui
2024-09-09 19:13:58 -07:00
committed by Copybara-Service
parent c358dedd91
commit 30c8e0e722
3 changed files with 6 additions and 12 deletions
@@ -40,11 +40,6 @@ cc_library(
"timer.h",
"utils.h",
],
copts = [
"-Ithird_party/nearby/internal/platform/implementation/windows/generated",
"-Wno-non-virtual-dtor",
"-Wno-vla-extension",
],
defines = ["_SILENCE_CLANG_COROUTINE_MESSAGE"],
visibility = ["//sharing/internal/impl/windows:__pkg__"],
deps = [
@@ -197,8 +192,7 @@ cc_library(
# WFD API is only support after _WIN32_WINNT_WIN8, but the current lexan _WIN32_WINNT is set to _WIN32_WINNT_WIN7
copts = [
"-DNO_INTEL_PIE",
"-Ithird_party/nearby/internal/platform/implementation/windows/generated -D_WIN32_WINNT=_WIN32_WINNT_WIN10 -DWINVER=_WIN32_WINNT_WIN10",
"-Wno-non-virtual-dtor",
"-D_WIN32_WINNT=_WIN32_WINNT_WIN10 -DWINVER=_WIN32_WINNT_WIN10",
"-Wno-unused-variable",
"-Wno-unused-value",
],
@@ -294,7 +288,7 @@ cc_test(
"wifi_hotspot_test.cc",
"wifi_medium_test.cc",
],
copts = ["-Ithird_party/nearby/internal/platform/implementation/windows/generated -DCORE_ADAPTER_DLL"],
copts = ["-DCORE_ADAPTER_DLL"],
tags = ["nozapfhahn"],
deps = [
":comm",
@@ -65,8 +65,8 @@ std::optional<std::string> DeviceInfo::GetOsDeviceName() const {
}
}
WCHAR device_name[size];
if (GetComputerNameExW(ComputerNameDnsHostname, device_name, &size)) {
std::wstring device_name(size, L' ');
if (GetComputerNameExW(ComputerNameDnsHostname, device_name.data(), &size)) {
winrt::hstring device_name_str(device_name);
return winrt::to_string(device_name_str);
}
@@ -15,7 +15,8 @@ licenses(["notice"])
cc_library(
name = "types",
copts = ["-Wno-non-virtual-dtor"],
hdrs = glob(["**/*.h"]),
includes = ["."],
linkopts = [
"wininet.lib",
"advapi32.lib",
@@ -40,7 +41,6 @@ cc_library(
"wlanapi.lib",
"shlwapi.lib",
],
textual_hdrs = glob(["**/*.h"]),
visibility = [
"//fastpair:__subpackages__",
"//internal:__subpackages__",