Protect #pragma comment(lib, "foo") with _WIN32 checks
lld on Linux can now process #pragma comment(lib, "foo") macros which
results in build failures on Linux when lld is used. Fix this by
protecting these macros with _WIN32 checks.
MODIFY
src/tests.arguments.cpp
src/tests.arguments.cpp
#include "tests.pch.h"
+#if defined(_WIN32)
#pragma comment(lib, "version")
#pragma comment(lib, "winhttp")
+#endif
using namespace Microsoft::VisualStudio::CppUnitTestFramework;

MODIFY
src/tests.dependencies.cpp
src/tests.dependencies.cpp
#include "tests.pch.h"
+#if defined(_WIN32)
#pragma comment(lib, "version")
#pragma comment(lib, "winhttp")
+#endif
using namespace Microsoft::VisualStudio::CppUnitTestFramework;

MODIFY
src/tests.packagespec.cpp
src/tests.packagespec.cpp
#include <tests.utils.h>
+#if defined(_WIN32)
#pragma comment(lib, "version")
#pragma comment(lib, "winhttp")
+#endif
using namespace Microsoft::VisualStudio::CppUnitTestFramework;

MODIFY
src/tests.paragraph.cpp
src/tests.paragraph.cpp
#include "tests.pch.h"
+#if defined(_WIN32)
#pragma comment(lib, "version")
#pragma comment(lib, "winhttp")
+#endif
using namespace Microsoft::VisualStudio::CppUnitTestFramework;

MODIFY
src/vcpkg.cpp
src/vcpkg.cpp
#include <memory>
#include <random>
+#if defined(_WIN32)
#pragma comment(lib, "ole32")
#pragma comment(lib, "shell32")
+#endif
using namespace vcpkg;

MODIFY
src/vcpkg/base/system.cpp
src/vcpkg/base/system.cpp
#include <sys/sysctl.h>
#endif
+#if defined(_WIN32)
#pragma comment(lib, "Advapi32")
+#endif
using namespace vcpkg::System;

MODIFY
src/vcpkg/metrics.cpp
src/vcpkg/metrics.cpp
#include <vcpkg/base/strings.h>
#include <vcpkg/base/system.process.h>
+#if defined(_WIN32)
#pragma comment(lib, "version")
#pragma comment(lib, "winhttp")
+#endif
namespace vcpkg::Metrics
{

Protect #pragma comment(lib, "foo") with _WIN32 checks (#6867)

lld on Linux can now process #pragma comment(lib, "foo") macros which
results in build failures on Linux when lld is used. Fix this by
protecting these macros with _WIN32 checks.