Skip to content

Commit e9ec501

Browse files
committed
runtime: sprinkle some linker pragmas to autolink
This prepares the runtime to be closed with its dependencies when performing static linking. The pragma ensures that the linker will automatically pick up the dependent libraries avoiding the need to explicitly add the dependencies.
1 parent 6b2fb2e commit e9ec501

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

stdlib/public/runtime/Errors.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#define NOMINMAX
2020
#include <windows.h>
2121

22+
#pragma comment(lib, "User32.Lib")
23+
2224
#include <mutex>
2325
#endif
2426

stdlib/public/runtime/ImageInspectionCOFF.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#define NOMINMAX
2222
#include <Windows.h>
2323
#include <DbgHelp.h>
24+
25+
#pragma comment(lib, "DbgHelp.Lib")
2426
#endif
2527

2628
#include "swift/Runtime/Win32.h"

stdlib/public/runtime/SymbolInfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
#include <Windows.h>
1919
#include <DbgHelp.h>
2020
#include <psapi.h>
21+
22+
#pragma comment(lib, "DbgHelp.Lib")
23+
2124
#elif SWIFT_STDLIB_HAS_DLADDR
2225
#include <dlfcn.h>
2326
#endif

0 commit comments

Comments
 (0)