Open abeimler opened 2 years ago
I have taken the automated approach to the toolchains; the user should not need to specify the toolchains manually. We detect the proper toolchain based on the compiler settings and the target system.
For example, for the msvc toolchain: https://github.com/aminya/project_options/blob/370900da1d9df08146c1690a2a2c978122979716/src/VCEnvironment.cmake#L58-L64
We already detect MinGW and apply some fixes for it for VCPKG. You can use the same function to detect MinGW and include its toolchain.
Add function to setup
-DCMAKE_TOOLCHAIN_FILE
/-DVCPKG_TOOLCHAIN_FILE
andinclude()
toolchain via-DOPT_TARGET_TRIPLET:STRING=x64-mingw-dynamic
option.Example:
or with cmake arguments:
VCPKG_HOST_TRIPLET
,VCPKG_TRIPLET
andDVCPKG_CHAINLOAD_TOOLCHAIN_FILE
- https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md-DOPT_TARGET_TRIPLET
:x64-mingw-dynamic
,x64-mingw-static
- for Windows buildsx86-mingw-dynamic
,x86-mingw-static
- for Windows builds (32-Bit) (optional?)arm64-linux
,arm-linux
orarm64-windows
,arm-windows
- for ARM buildswasm32-emscripten
- for WebASM/Emscripten (optional)-DANDROID_NDK
and-DANDROID_ABI
emscript
,set_target_properties(${target} PROPERTIES LINK_FLAGS "-s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY -s USE_PTHREADS=1 --bind")
Notes
Upvote & Fund
I am using Polar.sh so you can upvote and help fund this issue. The funding is received once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.