Skip to content

Commit

Permalink
Protect #pragma comment(lib, "foo") with _WIN32 checks (#6867)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ismail authored and ras0219-msft committed Jun 12, 2019
1 parent 7014972 commit 8c49e56
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion toolsrc/src/tests.arguments.cpp
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -61,4 +63,4 @@ namespace UnitTest1
Assert::AreEqual(size_t{0}, v.command_arguments.size());
}
};
}
}
2 changes: 2 additions & 0 deletions toolsrc/src/tests.dependencies.cpp
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 2 additions & 0 deletions toolsrc/src/tests.packagespec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

#include <tests.utils.h>

#if defined(_WIN32)
#pragma comment(lib, "version")
#pragma comment(lib, "winhttp")
#endif

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

Expand Down
2 changes: 2 additions & 0 deletions toolsrc/src/tests.paragraph.cpp
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 2 additions & 0 deletions toolsrc/src/vcpkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
#include <memory>
#include <random>

#if defined(_WIN32)
#pragma comment(lib, "ole32")
#pragma comment(lib, "shell32")
#endif

using namespace vcpkg;

Expand Down
2 changes: 2 additions & 0 deletions toolsrc/src/vcpkg/base/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
#include <sys/sysctl.h>
#endif

#if defined(_WIN32)
#pragma comment(lib, "Advapi32")
#endif

using namespace vcpkg::System;

Expand Down
2 changes: 2 additions & 0 deletions toolsrc/src/vcpkg/metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
#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
{
Expand Down

0 comments on commit 8c49e56

Please sign in to comment.