diff --git a/toolsrc/src/tests.arguments.cpp b/toolsrc/src/tests.arguments.cpp index 72bdbdb65324ec..51ababd3db4f7e 100644 --- a/toolsrc/src/tests.arguments.cpp +++ b/toolsrc/src/tests.arguments.cpp @@ -1,7 +1,9 @@ #include "tests.pch.h" +#if defined(_WIN32) #pragma comment(lib, "version") #pragma comment(lib, "winhttp") +#endif using namespace Microsoft::VisualStudio::CppUnitTestFramework; @@ -61,4 +63,4 @@ namespace UnitTest1 Assert::AreEqual(size_t{0}, v.command_arguments.size()); } }; -} \ No newline at end of file +} diff --git a/toolsrc/src/tests.dependencies.cpp b/toolsrc/src/tests.dependencies.cpp index f82fad4e47490d..7d8283ed63b8e7 100644 --- a/toolsrc/src/tests.dependencies.cpp +++ b/toolsrc/src/tests.dependencies.cpp @@ -1,7 +1,9 @@ #include "tests.pch.h" +#if defined(_WIN32) #pragma comment(lib, "version") #pragma comment(lib, "winhttp") +#endif using namespace Microsoft::VisualStudio::CppUnitTestFramework; diff --git a/toolsrc/src/tests.packagespec.cpp b/toolsrc/src/tests.packagespec.cpp index 32ad81227aa13f..d3bc18c79b83ba 100644 --- a/toolsrc/src/tests.packagespec.cpp +++ b/toolsrc/src/tests.packagespec.cpp @@ -2,8 +2,10 @@ #include +#if defined(_WIN32) #pragma comment(lib, "version") #pragma comment(lib, "winhttp") +#endif using namespace Microsoft::VisualStudio::CppUnitTestFramework; diff --git a/toolsrc/src/tests.paragraph.cpp b/toolsrc/src/tests.paragraph.cpp index 9a56ad9ee3df5d..e99d07694e7013 100644 --- a/toolsrc/src/tests.paragraph.cpp +++ b/toolsrc/src/tests.paragraph.cpp @@ -1,7 +1,9 @@ #include "tests.pch.h" +#if defined(_WIN32) #pragma comment(lib, "version") #pragma comment(lib, "winhttp") +#endif using namespace Microsoft::VisualStudio::CppUnitTestFramework; diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index ab7586eebec357..e02bdc71f192e6 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -40,8 +40,10 @@ #include #include +#if defined(_WIN32) #pragma comment(lib, "ole32") #pragma comment(lib, "shell32") +#endif using namespace vcpkg; diff --git a/toolsrc/src/vcpkg/base/system.cpp b/toolsrc/src/vcpkg/base/system.cpp index a1185352411add..3d89d2fd4bff27 100644 --- a/toolsrc/src/vcpkg/base/system.cpp +++ b/toolsrc/src/vcpkg/base/system.cpp @@ -16,7 +16,9 @@ #include #endif +#if defined(_WIN32) #pragma comment(lib, "Advapi32") +#endif using namespace vcpkg::System; diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index 5ca2b056a18003..9dd520ed64c02e 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -9,8 +9,10 @@ #include #include +#if defined(_WIN32) #pragma comment(lib, "version") #pragma comment(lib, "winhttp") +#endif namespace vcpkg::Metrics {