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.
This commit is contained in:
Saleem Abdulrasool
2025-01-17 08:57:15 -08:00
parent 6b2fb2e4b4
commit e9ec50132f
3 changed files with 7 additions and 0 deletions

View File

@@ -19,6 +19,8 @@
#define NOMINMAX
#include <windows.h>
#pragma comment(lib, "User32.Lib")
#include <mutex>
#endif

View File

@@ -21,6 +21,8 @@
#define NOMINMAX
#include <Windows.h>
#include <DbgHelp.h>
#pragma comment(lib, "DbgHelp.Lib")
#endif
#include "swift/Runtime/Win32.h"

View File

@@ -18,6 +18,9 @@
#include <Windows.h>
#include <DbgHelp.h>
#include <psapi.h>
#pragma comment(lib, "DbgHelp.Lib")
#elif SWIFT_STDLIB_HAS_DLADDR
#include <dlfcn.h>
#endif