Choose MinGW triplets when building vcpkg with MinGW#32
Choose MinGW triplets when building vcpkg with MinGW#32dg0yt wants to merge 1 commit intomicrosoft:mainfrom
Conversation
|
I would prefer the use of |
|
Instead of using the MINGW macro, an explicit option in CMakeLists.txt (plus a project-defined macro to pass this choice the build) might be an alternative which even better complements the explicit |
|
I discovered more spots which need changes in order to support of MinGW as "native" WIN32 toolchain (alternative to MSVC).
I can continue on exploring the required changes. However I would like to know upfront how to handle the vcpk-tool build: Given the presence of MSYS2 in Azure Pipelines, support of MinGW as "native" WIN32 toolchain could be covered by CI. (And eventually, bootstrapping an additional MSYS2 vcpkg tool during Azure Pipelines image generation would validate that toolchain.) |
|
@dg0yt hmm, okay. I'll mark as requires:discussion so we can talk about it tomorrow. |
Just to be clear, could you lay out the full scenario that you're trying to enable? For example, we generally intend the vast majority of Windows users to consume the precompiled, signed binaries that we are producing from our official pipeline (that's what bootstrap-vcpkg.bat does now -- just a download, no MSVC required). That isn't to say that we we don't want MinGW to be able to compile the vcpkg tool, but just that a feature like this will impact a vanishingly small number of people (and likely generate just as many bug reports of unexpected behavior). Additionally, even if the vcpkg tool embedded something like You might be happiest using overlay triplets or modifying your fork of vcpkg's |
|
Background: Why MSYS2: Why changes in vcpkg-tool: Last not least |
|
I can confirm that the default binary However, there is evidence for people struggling with such setups, e.g. microsoft/vcpkg#17092. Some issues might be mitigated by a better documentation entry point, for example similar to https://vcpkg.readthedocs.io/en/latest/users/android/. Other than modifying |
|
Agreed that some docs on how to use vcpkg in a pure mingw environment would be great. Based on my understanding, for classic mode this should be as simple as set VCPKG_DEFAULT_HOST_TRIPLET=x64-mingw-dynamic
set VCPKG_DEFAULT_TRIPLET=x64-mingw-dynamicFor manifest mode, users currently would need to do set VCPKG_DEFAULT_HOST_TRIPLET=x64-mingw-dynamic
cmake -DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic .. /* usual arguments */Alternatively, in both cases, a user can copy+rename set VCPKG_OVERLAY_TRIPLETS=%LOCALAPPDATA%/.vcpkg/tripletswhich should Just Work for all modes, since |
Now started at microsoft/vcpkg#17219. |
|
@dg0yt Now that microsoft/vcpkg#17219 has been merged, do you think this should be closed? |
|
@ras0219-msft It is okay to close it now. |
This commit enables build and use of vcpkg on Windows systems which only have a MSYS2 MinGW environment.
This PR is complemented by #31 and a pending change to bootstrapping (dg0yt/vcpkg@31c31d9, pointless without #31).
Tested only with x64-mingw-dynamic and zlib.