[vcpkg-scripts] Catch use of ambiguous cmake vars (#34546)

Avoid wrong use of popular but ambiguous variables (`WIN32` etc.) in
scripts and portfiles by detection in CI.

Sometimes the variables are used wrongly, and sometimes this isn't
caught in PR review. This PR tries to catch those variables (when in the
active code path in script mode). [This can happen to every
contributor](https://github.com/microsoft/vcpkg/pull/34356#discussion_r1360074122),
even if he/she knows the rules ... vcpkg is raising the bar higher than
usual, having to deal with targets and hosts even in script mode.

(`b2-options.cmake` (boost fragment) shows where we get if we don't pay
attention: the same code being used in script mode (`WIN32` meaning
host) and in project mode (`WIN32` meaning target).)

The new check doesn't break any user builds because it relies on command
line options. However it changes the ABI hashes.
This commit is contained in:
Kai Pastor 2024-06-14 20:40:01 +02:00 committed by GitHub
parent 039c6ee20a
commit 47633daa65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
63 changed files with 198 additions and 98 deletions

View File

@ -18,7 +18,7 @@ endif()
set(ANGLE_USE_D3D11_COMPOSITOR_NATIVE_WINDOW "OFF")
if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
set(ANGLE_BUILDSYSTEM_PORT "Win")
if (NOT MINGW)
if (NOT VCPKG_TARGET_IS_MINGW)
set(ANGLE_USE_D3D11_COMPOSITOR_NATIVE_WINDOW "ON")
endif()
elseif (VCPKG_TARGET_IS_OSX)

View File

@ -1,7 +1,7 @@
{
"name": "angle",
"version-string": "chromium_5414",
"port-version": 7,
"port-version": 8,
"description": [
"A conformant OpenGL ES implementation for Windows, Mac and Linux.",
"The goal of ANGLE is to allow users of multiple operating systems to seamlessly run WebGL and other OpenGL ES content by translating OpenGL ES API calls to one of the hardware-supported APIs available for that platform. ANGLE currently provides translation from OpenGL ES 2.0 and 3.0 to desktop OpenGL, OpenGL ES, Direct3D 9, and Direct3D 11. Support for translation from OpenGL ES to Vulkan is underway, and future plans include compute shader support (ES 3.1) and MacOS support."

View File

@ -1,4 +1,4 @@
if(WIN32)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

View File

@ -1,6 +1,7 @@
{
"name": "ed25519",
"version-date": "2017-02-10",
"port-version": 1,
"description": "Portable C implementation of Ed25519, a high-speed high-security public-key signature system.",
"homepage": "https://github.com/orlp/ed25519",
"license": "Zlib",

View File

@ -109,7 +109,7 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
if(APPLE)
if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS)
file(REMOVE "${CURRENT_PACKAGES_DIR}/uninstall.command" "${CURRENT_PACKAGES_DIR}/debug/uninstall.command")
endif()
file(RENAME "${CURRENT_PACKAGES_DIR}/share/doc" "${CURRENT_PACKAGES_DIR}/share/${PORT}/")

View File

@ -1,7 +1,7 @@
{
"name": "embree3",
"version": "3.13.5",
"port-version": 3,
"port-version": 4,
"description": "High Performance Ray Tracing Kernels.",
"homepage": "https://github.com/embree/embree",
"license": "Apache-2.0",

View File

@ -12,7 +12,7 @@ vcpkg_extract_source_archive(SOURCE_PATH
libintl.patch
)
if(APPLE)
if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS)
list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DVCPKG_ENABLE_OBJC=1")
endif()

View File

@ -1,7 +1,7 @@
{
"name": "glib",
"version": "2.78.4",
"port-version": 1,
"port-version": 2,
"description": "Portable, general-purpose utility library.",
"homepage": "https://developer.gnome.org/glib/",
"license": "LGPL-2.1-or-later",

View File

@ -25,8 +25,8 @@ vcpkg_cmake_configure(
)
vcpkg_cmake_install()
if (WIN32)
vcpkg_cmake_config_fixup(PACKAGE_NAME GTSAM CONFIG_PATH CMAKE)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_cmake_config_fixup(PACKAGE_NAME GTSAM CONFIG_PATH CMake)
else()
vcpkg_cmake_config_fixup(PACKAGE_NAME GTSAM CONFIG_PATH lib/cmake/GTSAM)
endif()

View File

@ -1,7 +1,7 @@
{
"name": "gtsam",
"version-string": "4.2a9",
"port-version": 1,
"port-version": 2,
"description": "GTSAM is a library of C++ classes that implement smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes networks as the underlying computing paradigm rather than sparse matrices.",
"homepage": "https://github.com/borglab/gtsam",
"license": "BSD-3-Clause",

View File

@ -1,4 +1,4 @@
if(WIN32)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

View File

@ -1,7 +1,7 @@
{
"name": "hash-library",
"version": "8",
"port-version": 2,
"port-version": 3,
"description": "Portable C++ hashing library",
"homepage": "https://create.stephan-brumme.com/hash-library/",
"license": "Zlib",

View File

@ -1,4 +1,4 @@
if(WIN32)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

View File

@ -1,7 +1,7 @@
{
"name": "keccak-tiny",
"version-date": "2014-09-08",
"port-version": 1,
"port-version": 2,
"description": "A tiny implementation of SHA-3, SHAKE, Keccak, and sha3sum",
"homepage": "https://github.com/coruus/keccak-tiny",
"license": "CC0-1.0",

View File

@ -2,7 +2,7 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO LibreDWG/libredwg
REF "${VERSION}"
SHA512 cf0baf477d053eb6ab2feaeda187f2d92211c7d28aa50318c1c8d7acf1b9c463258fa3a388dddce266bf44e0d4e4cf1bd3aa591c918f8a253515919e5c1b3f57
SHA512 cf0baf477d053eb6ab2feaeda187f2d92211c7d28aa50318c1c8d7acf1b9c463258fa3a388dddce266bf44e0d4e4cf1bd3aa591c918f8a253515919e5c1b3f57
HEAD_REF master
PATCHES
fix_install.patch
@ -17,19 +17,17 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
)
# libredwg will read the version
file(WRITE "${SOURCE_PATH}/.version" ${VERSION})
file(WRITE "${SOURCE_PATH}/.version" "${VERSION}")
# Fix https://github.com/LibreDWG/libredwg/issues/652#issuecomment-1454035167
if(APPLE)
vcpkg_replace_string("${SOURCE_PATH}/src/common.h"
vcpkg_replace_string("${SOURCE_PATH}/src/common.h"
[[defined(COMMON_TEST_C)]]
[[1]]
)
vcpkg_replace_string("${SOURCE_PATH}/src/common.c"
[[(defined COMMON_TEST_C || defined __APPLE__)]]
)
vcpkg_replace_string("${SOURCE_PATH}/src/common.c"
[[defined(COMMON_TEST_C)]]
[[1]]
)
endif()
[[(defined COMMON_TEST_C || defined __APPLE__)]]
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
@ -47,7 +45,6 @@ vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libredwg CONFIG_PATH share/unof
if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES dwg2dxf dwg2SVG dwgbmp dwggrep dwglayers dwgread dwgrewrite dwgwrite dxf2dwg AUTO_CLEAN)
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/libredwg")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")

View File

@ -1,6 +1,7 @@
{
"name": "libredwg",
"version": "0.13.3",
"port-version": 1,
"description": "GNU LibreDWG is a free C library to handle DWG files. It aims to be a free replacement for the OpenDWG libraries. DWG is the native file format of AutoCAD.",
"homepage": "https://www.gnu.org/software/libredwg/",
"license": "GPL-3.0",

View File

@ -1,4 +1,4 @@
if (WIN32)
if(VCPKG_TARGET_IS_WINDOWS)
set(PATCHES fix-POSIX_name.patch)
endif()

View File

@ -1,7 +1,7 @@
{
"name": "libyaml",
"version": "0.2.5",
"port-version": 4,
"port-version": 5,
"description": "A C library for parsing and emitting YAML.",
"homepage": "https://github.com/yaml/libyaml",
"dependencies": [

View File

@ -131,7 +131,7 @@ else()
#
# We delete the import libraries here to avoid the auto-magic linking
# for plugins which are loaded at runtime.
if(WIN32)
if(VCPKG_TARGET_IS_WINDOWS)
set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/magnum")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/magnum-d")

View File

@ -1,7 +1,7 @@
{
"name": "magnum-plugins",
"version-string": "2020.06",
"port-version": 12,
"port-version": 13,
"description": "Plugins for magnum, C++11/C++14 graphics middleware for games and data visualization",
"homepage": "https://magnum.graphics/",
"license": null,

View File

@ -118,7 +118,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(COPY ${LIB_TO_MOVE_DBG} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/magnum")
else()
if(WIN32)
if(VCPKG_TARGET_IS_WINDOWS)
file(GLOB_RECURSE LIB_TO_REMOVE "${CURRENT_PACKAGES_DIR}/lib/magnum/*")
file(GLOB_RECURSE LIB_TO_KEEP "${CURRENT_PACKAGES_DIR}/lib/magnum/*Any*")
if(LIB_TO_KEEP)

View File

@ -1,7 +1,7 @@
{
"name": "magnum",
"version-string": "2020.06",
"port-version": 17,
"port-version": 18,
"description": "C++11/C++14 graphics middleware for games and data visualization",
"homepage": "https://magnum.graphics/",
"license": null,

View File

@ -24,7 +24,7 @@ vcpkg_find_acquire_program(BISON)
get_filename_component(BISON_DIR "${BISON}" DIRECTORY)
vcpkg_add_to_path(PREPEND "${BISON_DIR}")
if(WIN32) # WIN32 HOST probably has win_flex and win_bison!
if(CMAKE_HOST_WIN32) # WIN32 HOST probably has win_flex and win_bison!
if(NOT EXISTS "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}")
if(FLEX_DIR MATCHES "${DOWNLOADS}")
file(CREATE_LINK "${FLEX}" "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}")

View File

@ -1,7 +1,7 @@
{
"name": "mesa",
"version": "24.0.7",
"port-version": 1,
"port-version": 2,
"description": "Mesa - The 3D Graphics Library",
"homepage": "https://www.mesa3d.org/",
"license": "MIT AND BSL-1.0 AND SGI-B-2.0",

View File

@ -71,7 +71,7 @@ x_vcpkg_get_python_packages(PYTHON_VERSION "3" PACKAGES html5lib OUT_PYTHON_VAR
vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf")
set(GPERF "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf/gperf${VCPKG_HOST_EXECUTABLE_SUFFIX}")
if(WIN32) # WIN32 HOST probably has win_flex and win_bison!
if(CMAKE_HOST_WIN32) # WIN32 HOST probably has win_flex and win_bison!
if(NOT EXISTS "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}")
file(CREATE_LINK "${FLEX}" "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}")
endif()

View File

@ -2,7 +2,7 @@
"$comment": "x86-windows is not within the upstream support matrix of Qt6",
"name": "qtwebengine",
"version": "6.7.0",
"port-version": 3,
"port-version": 4,
"description": "Qt WebEngine provides functionality for rendering regions of dynamic web content.",
"homepage": "https://www.qt.io/",
"license": null,

View File

@ -1,4 +1,3 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO simbody/simbody
@ -28,7 +27,7 @@ vcpkg_cmake_configure(
vcpkg_cmake_install()
if(WIN32)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
else()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")

View File

@ -1,6 +1,7 @@
{
"name": "simbody",
"version-date": "2023-01-10",
"port-version": 1,
"description": "High-performance C++ multibody dynamics/physics library for simulating articulated biomechanical and mechanical systems like vehicles, robots, and the human skeleton.",
"homepage": "https://simtk.org/home/simbody",
"license": "Apache-2.0",

View File

@ -1,7 +1,7 @@
{
"name": "vcpkg-qmake",
"version-date": "2023-03-22",
"port-version": 1,
"port-version": 2,
"documentation": "https://vcpkg.io/en/docs/README.html",
"license": "MIT",
"supports": "native",

View File

@ -4,7 +4,7 @@ function(z_vcpkg_qmake_fix_makefiles BUILD_DIR)
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR)
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR)
if(WIN32)
if(CMAKE_HOST_WIN32)
string(SUBSTRING "${NATIVE_INSTALLED_DIR}" 2 -1 INSTALLED_DIR_WITHOUT_DRIVE)
string(SUBSTRING "${NATIVE_PACKAGES_DIR}" 2 -1 PACKAGES_DIR_WITHOUT_DRIVE)
string(SUBSTRING "${NATIVE_INSTALLED_DIR}" 0 2 INSTALLED_DRIVE)

View File

@ -1,7 +1,7 @@
{
"name": "vcpkg-tool-meson",
"version": "1.3.2",
"port-version": 5,
"port-version": 6,
"description": "Meson build system",
"homepage": "https://github.com/mesonbuild/meson",
"license": "Apache-2.0",

View File

@ -189,13 +189,13 @@ function(z_vcpkg_get_build_and_host_system build_system host_system is_cross) #h
set(build "[build_machine]\n") # Machine the build is performed on
string(APPEND build "endian = 'little'\n")
if(WIN32)
if(CMAKE_HOST_WIN32)
string(APPEND build "system = 'windows'\n")
elseif(DARWIN)
elseif(CMAKE_HOST_APPLE)
string(APPEND build "system = 'darwin'\n")
elseif(CYGWIN)
string(APPEND build "system = 'cygwin'\n")
elseif(UNIX)
elseif(CMAKE_HOST_UNIX)
string(APPEND build "system = 'linux'\n")
else()
set(build_unknown TRUE)
@ -253,7 +253,7 @@ function(z_vcpkg_get_build_and_host_system build_system host_system is_cross) #h
if(NOT build_cpu_fam MATCHES "${host_cpu_fam}"
OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_IOS OR VCPKG_TARGET_IS_UWP
OR (VCPKG_TARGET_IS_MINGW AND NOT WIN32))
OR (VCPKG_TARGET_IS_MINGW AND NOT CMAKE_HOST_WIN32))
set(${is_cross} TRUE PARENT_SCOPE)
endif()
endfunction()

View File

@ -31,7 +31,7 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/license.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
if(WIN32 AND (NOT MINGW))
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/wavpack.pc" "-lwavpack" "-lwavpackdll")

View File

@ -1,7 +1,7 @@
{
"name": "wavpack",
"version": "5.6.0",
"port-version": 1,
"port-version": 2,
"description": "WavPack encode/decode library, command-line programs, and several plugins",
"homepage": "https://github.com/dbry/WavPack",
"license": "BSD-3-Clause",

View File

@ -26,7 +26,7 @@ vcpkg_configure_make(
vcpkg_install_make()
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/xorg/")
if(NOT WIN32)
if(NOT CMAKE_HOST_WIN32)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/xorg/aclocal/")
endif()
@ -48,7 +48,7 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/pkgconfig/xorg-macros.pc"
string(REPLACE "datarootdir=\${prefix}/share}" "datarootdir=\${prefix}/share/xorg/debug}" _contents "${_contents}")
string(REPLACE "includedir=${CURRENT_INSTALLED_DIR}/debug/include" "includedir=\${prefix}/../include" _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/debug/share/pkgconfig/xorg-macros.pc" "${_contents}")
if(NOT WIN32)
if(NOT CMAKE_HOST_WIN32)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/xorg/debug/")
endif()
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib")

View File

@ -1,6 +1,7 @@
{
"name": "xorg-macros",
"version": "1.19.3",
"port-version": 1,
"description": "X.org macros utilities.",
"homepage": "https://xcb.freedesktop.org/",
"license": null,

View File

@ -23,39 +23,25 @@ vcpkg_configure_make(
)
vcpkg_install_make()
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/xorg")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}")
if(NOT WIN32)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}/include")
endif()
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib")
if(NOT VCPKG_BUILD_TYPE)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib")
endif()
file(RENAME "${CURRENT_PACKAGES_DIR}/include/" "${CURRENT_PACKAGES_DIR}/share/${PORT}/include/")
# the include folder is moved since it contains source files. It is not meant as a traditional include folder but as a shared files folder for different x libraries.
file(RENAME "${CURRENT_PACKAGES_DIR}/include" "${CURRENT_PACKAGES_DIR}/share/${PORT}/include")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/pkgconfig/" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/aclocal/" "${CURRENT_PACKAGES_DIR}/share/xorg/aclocal")
if(NOT VCPKG_BUILD_TYPE)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/pkgconfig" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/" "${CURRENT_PACKAGES_DIR}/share/xorg/debug")
endif()
vcpkg_fixup_pkgconfig() # must be called after files have been moved
set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/xtrans.pc" )
file(READ "${_file}" _contents)
string(REPLACE "includedir=\${prefix}/include" "includedir=\${prefix}/share/xtrans/include" _contents "${_contents}")
file(WRITE "${_file}" "${_contents}")
set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/xtrans.pc" )
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/xtrans.pc" "includedir=\${prefix}/include" "includedir=\${prefix}/share/${PORT}/include")
if(NOT VCPKG_BUILD_TYPE)
file(READ "${_file}" _contents)
string(REPLACE "includedir=\${prefix}/../include" "includedir=\${prefix}/../share/xtrans/include" _contents "${_contents}")
file(WRITE "${_file}" "${_contents}")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/xtrans.pc" "includedir=\${prefix}/../include" "includedir=\${prefix}/../share/${PORT}/include")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

View File

@ -1,7 +1,7 @@
{
"name": "xtrans",
"version": "1.4.0",
"port-version": 1,
"port-version": 2,
"description": "xtrans - X Network Transport layer shared code",
"homepage": "https://gitlab.freedesktop.org/xorg/lib/libxtrans",
"license": null,

View File

@ -29,8 +29,8 @@ function(vcpkg_build_make)
set(arg_INSTALL_TARGET "install")
endif()
if(WIN32)
set(Z_VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR})
if(CMAKE_HOST_WIN32)
set(Z_VCPKG_INSTALLED "${CURRENT_INSTALLED_DIR}")
else()
string(REPLACE " " "\ " Z_VCPKG_INSTALLED "${CURRENT_INSTALLED_DIR}")
endif()

View File

@ -189,13 +189,13 @@ function(z_vcpkg_get_build_and_host_system build_system host_system is_cross) #h
set(build "[build_machine]\n") # Machine the build is performed on
string(APPEND build "endian = 'little'\n")
if(WIN32)
if(CMAKE_HOST_WIN32)
string(APPEND build "system = 'windows'\n")
elseif(DARWIN)
elseif(CMAKE_HOST_APPLE)
string(APPEND build "system = 'darwin'\n")
elseif(CYGWIN)
elseif(VCPKG_HOST_IS_CYGWIN)
string(APPEND build "system = 'cygwin'\n")
elseif(UNIX)
elseif(CMAKE_HOST_UNIX)
string(APPEND build "system = 'linux'\n")
else()
set(build_unknown TRUE)
@ -253,7 +253,7 @@ function(z_vcpkg_get_build_and_host_system build_system host_system is_cross) #h
if(NOT build_cpu_fam MATCHES "${host_cpu_fam}"
OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_IOS OR VCPKG_TARGET_IS_UWP
OR (VCPKG_TARGET_IS_MINGW AND NOT WIN32))
OR (VCPKG_TARGET_IS_MINGW AND NOT CMAKE_HOST_WIN32))
set(${is_cross} TRUE PARENT_SCOPE)
endif()
endfunction()

View File

@ -14,7 +14,7 @@ else()
set(program_name bison)
set(apt_package_name bison)
set(brew_package_name bison)
if (APPLE)
if (CMAKE_HOST_APPLE)
set(paths_to_search /opt/homebrew/opt/bison/bin /usr/local/opt/bison/bin)
endif()
endif()

View File

@ -10,11 +10,14 @@ function(vcpkg_find_fortran out_var)
set(CMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_BINARY_DIR}")
set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_BINARY_DIR}/Platform")
macro(z_vcpkg_warn_ambiguous_system_variables)
# CMakeDetermineFortranCompiler is for project mode.
endmacro()
include(CMakeDetermineFortranCompiler)
if(NOT CMAKE_Fortran_COMPILER AND "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" STREQUAL "")
# If a user uses their own VCPKG_CHAINLOAD_TOOLCHAIN_FILE, they _must_ figure out fortran on their own.
if(WIN32)
if(CMAKE_HOST_WIN32)
message(STATUS "No Fortran compiler found on the PATH. Using MinGW gfortran!")
# If no Fortran compiler is on the path we switch to use gfortan from MinGW within vcpkg
if("${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "x86")

View File

@ -163,6 +163,22 @@ if(CMD STREQUAL "BUILD")
set(TRIPLET_SYSTEM_ARCH "${VCPKG_TARGET_ARCHITECTURE}")
include("${SCRIPTS}/cmake/vcpkg_common_definitions.cmake")
function(z_vcpkg_warn_ambiguous_system_variables VARIABLE ACCESS VALUE POS STACK)
message("${Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL}" "Unexpected ${ACCESS} on variable ${VARIABLE} in script mode.
This variable name insufficiently expresses whether it refers to the \
target system or to the host system. Use a prefixed variable instead.
- Variables providing information about the host:
CMAKE_HOST_<SYSTEM>
VCPKG_HOST_IS_<SYSTEM>
- Variables providing information about the target:
VCPKG_TARGET_IS_<SYSTEM>
VCPKG_DETECTED_<VARIABLE> (using vcpkg_cmake_get_vars)
")
endfunction()
foreach(var IN ITEMS ANDROID APPLE BSD IOS LINUX MINGW MSVC UNIX WIN32)
variable_watch("${var}" z_vcpkg_warn_ambiguous_system_variables)
endforeach()
if (DEFINED VCPKG_PORT_CONFIGS)
foreach(VCPKG_PORT_CONFIG IN LISTS VCPKG_PORT_CONFIGS)
include("${VCPKG_PORT_CONFIG}")

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1729007831807f980abc75357ab0e73f0f9216cf",
"version-string": "chromium_5414",
"port-version": 8
},
{
"git-tree": "b5502570ef18abdcf0535470f3ea6589db70607b",
"version-string": "chromium_5414",

View File

@ -130,7 +130,7 @@
},
"angle": {
"baseline": "chromium_5414",
"port-version": 7
"port-version": 8
},
"ankurvdev-embedresource": {
"baseline": "0.0.11",
@ -2458,7 +2458,7 @@
},
"ed25519": {
"baseline": "2017-02-10",
"port-version": 0
"port-version": 1
},
"edflib": {
"baseline": "1.25",
@ -2506,7 +2506,7 @@
},
"embree3": {
"baseline": "3.13.5",
"port-version": 3
"port-version": 4
},
"enet": {
"baseline": "1.3.17",
@ -3078,7 +3078,7 @@
},
"glib": {
"baseline": "2.78.4",
"port-version": 1
"port-version": 2
},
"glib-networking": {
"baseline": "2.78.0",
@ -3258,7 +3258,7 @@
},
"gtsam": {
"baseline": "4.2a9",
"port-version": 1
"port-version": 2
},
"guetzli": {
"baseline": "2020-09-14",
@ -3362,7 +3362,7 @@
},
"hash-library": {
"baseline": "8",
"port-version": 2
"port-version": 3
},
"hashids": {
"baseline": "1.2.1",
@ -3862,7 +3862,7 @@
},
"keccak-tiny": {
"baseline": "2014-09-08",
"port-version": 1
"port-version": 2
},
"kenlm": {
"baseline": "20230531",
@ -4894,7 +4894,7 @@
},
"libredwg": {
"baseline": "0.13.3",
"port-version": 0
"port-version": 1
},
"libremidi": {
"baseline": "4.5.0",
@ -5334,7 +5334,7 @@
},
"libyaml": {
"baseline": "0.2.5",
"port-version": 4
"port-version": 5
},
"libyuv": {
"baseline": "1857",
@ -5562,7 +5562,7 @@
},
"magnum": {
"baseline": "2020.06",
"port-version": 17
"port-version": 18
},
"magnum-extras": {
"baseline": "2020.06",
@ -5574,7 +5574,7 @@
},
"magnum-plugins": {
"baseline": "2020.06",
"port-version": 12
"port-version": 13
},
"mailio": {
"baseline": "0.23.0",
@ -5698,7 +5698,7 @@
},
"mesa": {
"baseline": "24.0.7",
"port-version": 1
"port-version": 2
},
"meschach": {
"baseline": "1.2b",
@ -7502,7 +7502,7 @@
},
"qtwebengine": {
"baseline": "6.7.0",
"port-version": 3
"port-version": 4
},
"qtwebsockets": {
"baseline": "6.7.1",
@ -8146,7 +8146,7 @@
},
"simbody": {
"baseline": "2023-01-10",
"port-version": 0
"port-version": 1
},
"simd": {
"baseline": "5.3.128",
@ -9126,7 +9126,7 @@
},
"vcpkg-qmake": {
"baseline": "2023-03-22",
"port-version": 1
"port-version": 2
},
"vcpkg-tool-bazel": {
"baseline": "5.2.0",
@ -9146,7 +9146,7 @@
},
"vcpkg-tool-meson": {
"baseline": "1.3.2",
"port-version": 5
"port-version": 6
},
"vcpkg-tool-mozbuild": {
"baseline": "4.0.2",
@ -9318,7 +9318,7 @@
},
"wavpack": {
"baseline": "5.6.0",
"port-version": 1
"port-version": 2
},
"wayland": {
"baseline": "1.21.0",
@ -9550,7 +9550,7 @@
},
"xorg-macros": {
"baseline": "1.19.3",
"port-version": 0
"port-version": 1
},
"xorstr": {
"baseline": "2021-11-20",
@ -9598,7 +9598,7 @@
},
"xtrans": {
"baseline": "1.4.0",
"port-version": 1
"port-version": 2
},
"xxhash": {
"baseline": "0.8.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ce2c9dc71e927201adc881b0cfb43341520161ae",
"version-date": "2017-02-10",
"port-version": 1
},
{
"git-tree": "c62f7e2a6268b66c80e20287872725e8bc273032",
"version-date": "2017-02-10",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "67707a39d2505eb22c7b9449a61e2d2d9d858d99",
"version": "3.13.5",
"port-version": 4
},
{
"git-tree": "ff35cda43407d9fd76af567f3284e9eb988307fe",
"version": "3.13.5",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cce839ba5ebec8b3a772b2fad1ab73f6bbd5b715",
"version": "2.78.4",
"port-version": 2
},
{
"git-tree": "d73077209c5fcb5a0340baf7d8ba76d128c1ab27",
"version": "2.78.4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9c2a1fefb94d0fe792cde3fe6519ce59e181685a",
"version-string": "4.2a9",
"port-version": 2
},
{
"git-tree": "e7b2023df7e13e479e6861ba1c6ace9ae9d2cfbf",
"version-string": "4.2a9",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "815f018f0a7ef2c32f828276ee7abb191b4b64db",
"version": "8",
"port-version": 3
},
{
"git-tree": "b3e49529dd25b60564de8ceed9485e17e8a7f8da",
"version": "8",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "dd3f2c18bec05d2d3c2962d67bb3dc05d489aaae",
"version-date": "2014-09-08",
"port-version": 2
},
{
"git-tree": "bc08abcfa95ff215f36528c540d82bcbecab4ee1",
"version-date": "2014-09-08",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e2990b43865e767fb74700ef4cf26b48934b47d8",
"version": "0.13.3",
"port-version": 1
},
{
"git-tree": "98054aab0c4648b6c88a29711decbd2586f4d462",
"version": "0.13.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3dd5d077b6d9d1015f1b1080bce5b6f22ca0763f",
"version": "0.2.5",
"port-version": 5
},
{
"git-tree": "ae6fcd42cb9d1448913be2c7eb536df813601230",
"version": "0.2.5",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e5200e6d2170dfc3221afb5ead09a32c2e92e51e",
"version-string": "2020.06",
"port-version": 13
},
{
"git-tree": "d1a7c4da316314fb8973e23a20c65fa926a96d44",
"version-string": "2020.06",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "87613165fa337f84fae12a9a2ed1e1ee93ec8fb9",
"version-string": "2020.06",
"port-version": 18
},
{
"git-tree": "fa47736590b34d1ce7158f0ebf783c2b54dcb004",
"version-string": "2020.06",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ea151768a6cf43fcfc6f579113e3f81b03b355bd",
"version": "24.0.7",
"port-version": 2
},
{
"git-tree": "04738625c7b81104ce8e66f296fd807c9dc05bce",
"version": "24.0.7",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b3e417987ee06530dae786426a2bdaada645d6bb",
"version": "6.7.0",
"port-version": 4
},
{
"git-tree": "60030ab0ec25c556ddde211877164346d453a6f9",
"version": "6.7.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "05384c70d836e25b147b7fca2cd601750315c088",
"version-date": "2023-01-10",
"port-version": 1
},
{
"git-tree": "c8b6a6d70b06b78e445b3c80cbded18415e22a7c",
"version-date": "2023-01-10",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d40f4f01a38812fcdabe63247a0ef204bcc01720",
"version-date": "2023-03-22",
"port-version": 2
},
{
"git-tree": "777a5dadc7b8c11b81d401098c70d3d66d4172b5",
"version-date": "2023-03-22",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "13f79b5e4c8b4c07b38f9b5a010965433b753bb4",
"version": "1.3.2",
"port-version": 6
},
{
"git-tree": "dcadef2870528d24faf78307c390e976d1daab19",
"version": "1.3.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7f568a69d6cfea01660bacc223ad2f5c61063a32",
"version": "5.6.0",
"port-version": 2
},
{
"git-tree": "d58b3734d0a42c7309216ade0432f7787fbd6ff5",
"version": "5.6.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "766525189c81d40661731faecc566fb96d66fcc4",
"version": "1.19.3",
"port-version": 1
},
{
"git-tree": "76db60fb182a4c33faabfb411e1842428ae4c8ad",
"version": "1.19.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f7f94e9ba7b242ac5b0f38e38fc6b32ac63c3024",
"version": "1.4.0",
"port-version": 2
},
{
"git-tree": "f270ddca7ea9e55a992a4923b373c4e47ad24ebd",
"version": "1.4.0",