Skip to content

Commit 3b968f6

Browse files
committed
CommandLineSupport: add a directive for autolinking on Windows
We use functions from Shell32.Lib. Ensure that we indicate the autolinking to the linker. This aides when building with a static runtime to avoid having to specify the additional library dependency for clients that are attempting to link against the runtime. This is particularly important for the CMake compiler check where we would need to list Shell32 as a required link library.
1 parent 50e3070 commit 3b968f6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/CommandLineSupport/CommandLine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#define WIN32_LEAN_AND_MEAN
3838
#include <Windows.h>
3939
#include <shellapi.h>
40+
#pragma comment(lib, "shell32.lib")
4041
#endif
4142

4243
// Backing storage for overrides of `Swift.CommandLine.arguments`.

0 commit comments

Comments
 (0)