aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg.cpp
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2020-01-18 00:36:08 +0100
committerVictor Romero <romerosanchezv@gmail.com>2020-01-17 15:36:08 -0800
commit38b959022cec1b865489d97a697eda84b49cc4e5 (patch)
tree20fcc2f8eedbb65f7067a1d6e077d2c616111e48 /toolsrc/src/vcpkg.cpp
parentf56645c3fd9a1561c430e90ce00836489b372ef8 (diff)
downloadvcpkg-38b959022cec1b865489d97a697eda84b49cc4e5.tar.gz
vcpkg-38b959022cec1b865489d97a697eda84b49cc4e5.zip
Add support for building with MinGW (#9137)
* Add support for building with MinGW Tested with MSYS2 MinGW 8.3.0, gcc-mcf.lhmouse MinGW 9.2.1, and StephanTLavavej/mingw-distro! * Add MinGW toolchain From your MinGW configured shell you could just use vcpkg to configure packages. An x64-mingw triplet would look like: ``` set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_ENV_PASSTHROUGH PATH) set(VCPKG_CMAKE_SYSTEM_NAME MinGW) ``` * Add MinGW community tripplets x64 tested with https://github.com/StephanTLavavej/mingw-distro x86, arm64, arm tested with https://github.com/mstorsjo/llvm-mingw
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
-rw-r--r--toolsrc/src/vcpkg.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index 2dd13f43d..1f212dd94 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -263,7 +263,18 @@ static void load_config()
#if defined(_WIN32)
// note: this prevents a false positive for -Wmissing-prototypes on clang-cl
-int wmain(int, const wchar_t* const*);
+int wmain(int, const wchar_t* const* const);
+
+#if !defined(_MSC_VER)
+#include <shellapi.h>
+int main(int argc, const char* const* const /*argv*/)
+{
+ wchar_t **wargv;
+ wargv = CommandLineToArgvW(GetCommandLineW(), &argc);
+ return wmain(argc, wargv);
+}
+#endif
+
int wmain(const int argc, const wchar_t* const* const argv)
#else
int main(const int argc, const char* const* const argv)