Skip to content

[vcpkg/scripts] move toolchain into triplet? #11546

Open
@Neumann-A

Description

The question is if we should move:

if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
if(NOT DEFINED VCPKG_CMAKE_SYSTEM_NAME OR _TARGETTING_UWP)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/linux.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/android.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/osx.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/ios.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake")
endif()
endif()

into the triplet instead an just define VCPKG_CHAINLOAD_TOOLCHAIN_FILE there. (would also require to set VCPKG_LOAD_VCVARS_ENV there so that VCPKG loads the environment for windows)
This also applies to the other configure scripts. This would make the use of the used toolchains more transparent for the outside and shows how to use a custom toolchain better.
We then should probably also move toolchains out of scripts into the vcpkg_root or maybe even into triplets?

Metadata

Labels

category:documentationTo resolve the issue, documentation will need to be updatedcategory:tool-updateThe issue is with build tool or build script, which requires update or should be executed correctly

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions