diff --git a/docs/users/triplets.md b/docs/users/triplets.md index 4bd9d7e1b4..f3ce26a302 100644 --- a/docs/users/triplets.md +++ b/docs/users/triplets.md @@ -93,6 +93,13 @@ This option also has forms for configuration-specific flags: - `VCPKG_LINKER_FLAGS_DEBUG` - `VCPKG_LINKER_FLAGS_RELEASE` +### VCPKG_MESON_CONFIGURE_OPTIONS +Set additional Meson configure options that are appended to the configure command (in [`vcpkg_configure_meson`](../maintainers/vcpkg_configure_meson.md)). + +This field is optional. + +Also available as build-type specific `VCPKG_MESON_CONFIGURE_OPTIONS_DEBUG` and `VCPKG_MESON_CONFIGURE_OPTIONS_RELEASE` variables. + ### VCPKG_CMAKE_CONFIGURE_OPTIONS Set additional CMake configure options that are appended to the configure command (in [`vcpkg_cmake_configure`](../maintainers/vcpkg_cmake_configure.md)). diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake index 94c1a9f616..e98beefbb2 100644 --- a/scripts/cmake/vcpkg_configure_meson.cmake +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -233,6 +233,9 @@ function(z_vcpkg_meson_generate_cross_file additional_binaries) #https://mesonbu elseif(MACHINE MATCHES "i386") set(build_cpu_fam x86) set(build_cpu i386) + elseif(MACHINE MATCHES "loongarch64") + set(build_cpu_fam loongarch64) + set(build_cpu loongarch64) else() # https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-tables.md#cpu-families message(FATAL_ERROR "Unhandled machine: ${MACHINE}") @@ -253,6 +256,9 @@ function(z_vcpkg_meson_generate_cross_file additional_binaries) #https://mesonbu elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)$") set(host_cpu_fam arm) set(host_cpu armv7hl) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "loongarch64") + set(host_cpu_fam loongarch64) + set(host_cpu loongarch64) else() message(FATAL_ERROR "Unsupported target architecture ${VCPKG_TARGET_ARCHITECTURE}!" ) endif() @@ -341,6 +347,17 @@ function(vcpkg_configure_meson) vcpkg_list(APPEND arg_OPTIONS --buildtype plain --backend ninja --wrap-mode nodownload) + # Allow overrides / additional configuration variables from triplets + if(DEFINED VCPKG_MESON_CONFIGURE_OPTIONS) + vcpkg_list(APPEND arg_OPTIONS ${VCPKG_MESON_CONFIGURE_OPTIONS}) + endif() + if(DEFINED VCPKG_MESON_CONFIGURE_OPTIONS_RELEASE) + vcpkg_list(APPEND arg_OPTIONS_RELEASE ${VCPKG_MESON_CONFIGURE_OPTIONS_RELEASE}) + endif() + if(DEFINED VCPKG_MESON_CONFIGURE_OPTIONS_DEBUG) + vcpkg_list(APPEND arg_OPTIONS_DEBUG ${VCPKG_MESON_CONFIGURE_OPTIONS_DEBUG}) + endif() + if(NOT vcpkg_meson_cross_file) z_vcpkg_meson_generate_cross_file("${arg_ADDITIONAL_CROSS_BINARIES}") endif()