early-access version 2853
This commit is contained in:
213
externals/vcpkg/scripts/test_ports/cmake-user/portfile.cmake
vendored
Executable file
213
externals/vcpkg/scripts/test_ports/cmake-user/portfile.cmake
vendored
Executable file
@@ -0,0 +1,213 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
set(cmake_commands "")
|
||||
if("cmake-current" IN_LIST FEATURES)
|
||||
list(APPEND cmake_commands "${CMAKE_COMMAND}")
|
||||
endif()
|
||||
if("cmake-3-7" IN_LIST FEATURES)
|
||||
set(cmake_version 3.7.2)
|
||||
string(REGEX REPLACE "([^.]*[.][^.]*).*" "\\1" cmake_major_minor "${cmake_version}")
|
||||
if(VCPKG_HOST_IS_WINDOWS)
|
||||
set(name "cmake-${cmake_version}-win32-x86")
|
||||
vcpkg_download_distfile(legacy_cmake_archive
|
||||
FILENAME "${name}.zip"
|
||||
URLS "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${name}.zip"
|
||||
"https://cmake.org/files/v${cmake_major_minor}/${name}.zip"
|
||||
SHA512 c359a22e2e688da1513db195280d6e8987bc8d570a0c543f1b1dfc8572fe4fd6c23d951ec5d5eae640fcca3bef3ae469083511474796ade8c6319d8bc4e4b38d
|
||||
)
|
||||
set(cmake_bin_dir "/bin")
|
||||
elseif(VCPKG_HOST_IS_OSX)
|
||||
set(name "cmake-${cmake_version}-Darwin-x86_64")
|
||||
vcpkg_download_distfile(legacy_cmake_archive
|
||||
FILENAME "${name}.tar.gz"
|
||||
URLS "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${name}.tar.gz"
|
||||
"https://cmake.org/files/v${cmake_major_minor}/${name}.tar.gz"
|
||||
SHA512 8e41608f4dd998020acf2bd1b0dab4aec37b3ea9e228f2c4a457cd1c0339d94db38a0548b4b07a9e3605f9beb11a3f6737a72813586c4ad5f730d74038a14c2b
|
||||
)
|
||||
set(cmake_bin_dir "/CMake.app/Contents/bin")
|
||||
elseif(VCPKG_HOST_IS_LINUX)
|
||||
set(name "cmake-${cmake_version}-Linux-x86_64")
|
||||
vcpkg_download_distfile(legacy_cmake_archive
|
||||
FILENAME "${name}.tar.gz"
|
||||
URLS "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${name}.tar.gz"
|
||||
"https://cmake.org/files/v${cmake_major_minor}/${name}.tar.gz"
|
||||
SHA512 459909fcfb9c74993c3d4ab9db4e31ea940515b670db44d039de611d813099895e695467cc8da24824315486e38e2f3e246aa92d6236c51103822ec8a39e3168
|
||||
)
|
||||
set(cmake_bin_dir "/bin")
|
||||
else()
|
||||
message(FATAL_ERROR "Unable to test feature 'cmake-3-7' for '${HOST_TRIPLET}' host.")
|
||||
endif()
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH legacy_cmake
|
||||
ARCHIVE "${legacy_cmake_archive}"
|
||||
REF "${cmake_version}"
|
||||
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${name}"
|
||||
)
|
||||
list(APPEND cmake_commands "${legacy_cmake}${cmake_bin_dir}/cmake")
|
||||
endif()
|
||||
|
||||
set(packages "")
|
||||
if("find-package" IN_LIST FEATURES)
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/vcpkg.json" vcpkg_json)
|
||||
string(JSON packages_json GET "${vcpkg_json}" "features" "find-package" "dependencies")
|
||||
string(JSON packages_count LENGTH "${packages_json}")
|
||||
if(packages_count GREATER 0)
|
||||
math(EXPR last "${packages_count} - 1")
|
||||
foreach(i RANGE 0 ${last})
|
||||
string(JSON package GET "${packages_json}" ${i} "$package")
|
||||
list(APPEND packages "${package}")
|
||||
endforeach()
|
||||
endif()
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
||||
list(REMOVE_ITEM packages "Curses")
|
||||
endif()
|
||||
if(VCPKG_TARGET_IS_LINUX)
|
||||
# Port wxwidgets requires linux system libraries which conflict with vcpkg ports.
|
||||
# This line complements the "platform" restriction from vcpkg.json.
|
||||
list(REMOVE_ITEM packages "wxWidgets")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{VCPKG_FORCE_SYSTEM_BINARIES})
|
||||
set(NINJA "ninja")
|
||||
else()
|
||||
vcpkg_find_acquire_program(NINJA)
|
||||
endif()
|
||||
|
||||
function(test_cmake_project)
|
||||
cmake_parse_arguments(PARSE_ARGV 0 "arg" "" "CMAKE_COMMAND;NAME" "OPTIONS")
|
||||
if(NOT arg_NAME)
|
||||
message(FATAL_ERROR "The NAME argument is mandatory.")
|
||||
endif()
|
||||
if(NOT arg_CMAKE_COMMAND)
|
||||
set(arg_CMAKE_COMMAND "${CMAKE_COMMAND}")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${arg_CMAKE_COMMAND}" --version
|
||||
OUTPUT_VARIABLE cmake_version_output
|
||||
RESULT_VARIABLE cmake_version_result
|
||||
)
|
||||
string(REGEX MATCH "[1-9][0-9]*\\.[0-9]*\\.[0-9]*" cmake_version "${cmake_version_output}")
|
||||
if(cmake_version_result OR NOT cmake_version)
|
||||
message(FATAL_ERROR "Unable to determine version for '${arg_CMAKE_COMMAND}'.")
|
||||
endif()
|
||||
|
||||
set(build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-${arg_NAME}")
|
||||
set(base_options
|
||||
-G "Ninja"
|
||||
"-DCMAKE_MAKE_PROGRAM=${NINJA}"
|
||||
"-DCMAKE_VERBOSE_MAKEFILE=ON"
|
||||
"-DCMAKE_TOOLCHAIN_FILE=${SCRIPTS}/buildsystems/vcpkg.cmake"
|
||||
"-DVCPKG_INSTALLED_DIR=${_VCPKG_INSTALLED_DIR}"
|
||||
"-DCMAKE_INSTALL_PREFIX=${build_dir}/install"
|
||||
"-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}"
|
||||
"-DVCPKG_MANIFEST_MODE=OFF"
|
||||
"-DCHECK_CMAKE_VERSION=${cmake_version}"
|
||||
)
|
||||
|
||||
if(DEFINED VCPKG_CMAKE_SYSTEM_NAME AND VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
list(APPEND base_options "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}")
|
||||
if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION)
|
||||
list(APPEND base_options "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}")
|
||||
endif()
|
||||
if(DEFINED VCPKG_PLATFORM_TOOLSET)
|
||||
list(APPEND base_options "-DVCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
list(APPEND base_options -DBUILD_SHARED_LIBS=ON)
|
||||
else()
|
||||
list(APPEND base_options -DBUILD_SHARED_LIBS=OFF)
|
||||
endif()
|
||||
|
||||
message(STATUS "Running tests with CMake ${cmake_version} for '${arg_NAME}'")
|
||||
file(REMOVE_RECURSE "${build_dir}")
|
||||
file(MAKE_DIRECTORY "${build_dir}")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND
|
||||
"${arg_CMAKE_COMMAND}" "${CMAKE_CURRENT_LIST_DIR}/project"
|
||||
${base_options}
|
||||
${arg_OPTIONS}
|
||||
WORKING_DIRECTORY "${build_dir}"
|
||||
LOGNAME "${TARGET_TRIPLET}-${cmake_version}-${arg_NAME}-config"
|
||||
)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND
|
||||
"${arg_CMAKE_COMMAND}" --build . --target install
|
||||
WORKING_DIRECTORY "${build_dir}"
|
||||
LOGNAME "${TARGET_TRIPLET}-${cmake_version}-${arg_NAME}-build"
|
||||
)
|
||||
# To produce better error messages for failing wrappers,
|
||||
# we run execute_process directly here, for each wrapper.
|
||||
string(REPLACE " OFF:" ":" message
|
||||
" CMake ${cmake_version}: @step@ with `find_package(@package@)` failed.\n"
|
||||
" See logs for more information:\n"
|
||||
" @log_out@\n"
|
||||
" @log_err@\n"
|
||||
)
|
||||
if(DEFINED ENV{BUILD_REASON}) # On Azure Pipelines, add extra markup.
|
||||
string(REPLACE " CMake" "##vso[task.logissue type=error]CMake" message "${message}")
|
||||
endif()
|
||||
foreach(package IN LISTS packages)
|
||||
string(MAKE_C_IDENTIFIER "${package}" package_string)
|
||||
set(find_package_build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-find-package-${package_string}-${arg_NAME}")
|
||||
set(log_out "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-find-package-${package_string}-${arg_NAME}-out.log")
|
||||
set(log_err "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-find-package-${package_string}-${arg_NAME}-err.log")
|
||||
|
||||
message(STATUS " find_package(${package})")
|
||||
file(REMOVE_RECURSE "${find_package_build_dir}")
|
||||
file(MAKE_DIRECTORY "${find_package_build_dir}")
|
||||
execute_process(
|
||||
COMMAND
|
||||
"${arg_CMAKE_COMMAND}" "${CMAKE_CURRENT_LIST_DIR}/project"
|
||||
${base_options}
|
||||
${arg_OPTIONS}
|
||||
"-DFIND_PACKAGES=${package}"
|
||||
OUTPUT_FILE "${log_out}"
|
||||
ERROR_FILE "${log_err}"
|
||||
RESULT_VARIABLE package_result
|
||||
WORKING_DIRECTORY "${find_package_build_dir}"
|
||||
)
|
||||
if(package_result)
|
||||
set(step "configuration")
|
||||
string(CONFIGURE "${message}" package_message @ONLY)
|
||||
message(SEND_ERROR "${package_message}")
|
||||
else()
|
||||
set(log_out "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-find-package-${package_string}-${arg_NAME}-build-out.log")
|
||||
set(log_err "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-find-package-${package_string}-${arg_NAME}-build-err.log")
|
||||
execute_process(
|
||||
COMMAND
|
||||
"${arg_CMAKE_COMMAND}" --build .
|
||||
OUTPUT_FILE "${log_out}"
|
||||
ERROR_FILE "${log_err}"
|
||||
RESULT_VARIABLE package_result
|
||||
WORKING_DIRECTORY "${find_package_build_dir}"
|
||||
)
|
||||
if(package_result)
|
||||
set(step "build")
|
||||
string(CONFIGURE "${message}" package_message @ONLY)
|
||||
message(SEND_ERROR "${package_message}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
foreach(executable IN LISTS cmake_commands)
|
||||
test_cmake_project(NAME "release"
|
||||
CMAKE_COMMAND "${executable}"
|
||||
OPTIONS
|
||||
"-DCMAKE_BUILD_TYPE=Release"
|
||||
"-DCMAKE_PREFIX_PATH=SYSTEM_LIBS" # for testing VCPKG_PREFER_SYSTEM_LIBS
|
||||
"-DVCPKG_PREFER_SYSTEM_LIBS=OFF"
|
||||
)
|
||||
test_cmake_project(NAME "debug"
|
||||
CMAKE_COMMAND "${executable}"
|
||||
OPTIONS
|
||||
"-DCMAKE_BUILD_TYPE=Debug"
|
||||
"-DCMAKE_PREFIX_PATH=SYSTEM_LIBS" # for testing VCPKG_PREFER_SYSTEM_LIBS
|
||||
"-DVCPKG_PREFER_SYSTEM_LIBS=ON"
|
||||
)
|
||||
endforeach()
|
109
externals/vcpkg/scripts/test_ports/cmake-user/project/CMakeLists.txt
vendored
Executable file
109
externals/vcpkg/scripts/test_ports/cmake-user/project/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,109 @@
|
||||
cmake_minimum_required(VERSION 3.4)
|
||||
project(cmake-user LANGUAGES C)
|
||||
|
||||
message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}")
|
||||
set(CHECK_CMAKE_VERSION "NOTFOUND" CACHE STRING "Version of CMake expected to be found")
|
||||
if(NOT CHECK_CMAKE_VERSION)
|
||||
message(WARNING "CMake version check: skipped (actual: ${CMAKE_VERSION})")
|
||||
elseif(NOT CHECK_CMAKE_VERSION VERSION_EQUAL CMAKE_VERSION)
|
||||
message(SEND_ERROR "CMake version check: failed (actual: ${CMAKE_VERSION} expected: ${CHECK_CMAKE_VERSION})")
|
||||
else()
|
||||
message(STATUS "CMake version check: success (actual: ${CMAKE_VERSION})")
|
||||
endif()
|
||||
|
||||
message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")
|
||||
list(FIND CMAKE_PREFIX_PATH "SYSTEM_LIBS" system_libs)
|
||||
list(FIND CMAKE_PREFIX_PATH "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" vcpkg)
|
||||
if(system_libs LESS 0)
|
||||
message(SEND_ERROR "VCPKG_PREFER_SYSTEM_LIBS check: failed (Cannot find SYSTEM_LIBS in CMAKE_PREFIX_PATH.)")
|
||||
elseif(vcpkg LESS 0)
|
||||
message(SEND_ERROR "VCPKG_PREFER_SYSTEM_LIBS check: failed (Cannot find vcpkg path in CMAKE_PREFIX_PATH.")
|
||||
elseif(VCPKG_PREFER_SYSTEM_LIBS AND system_libs GREATER vcpkg)
|
||||
message(SEND_ERROR "VCPKG_PREFER_SYSTEM_LIBS check: failed (actual: ${VCPKG_PREFER_SYSTEM_LIBS}, but vcpkg paths are before system paths in CMAKE_PREFIX_PATH.)")
|
||||
elseif(NOT VCPKG_PREFER_SYSTEM_LIBS AND system_libs LESS vcpkg)
|
||||
message(SEND_ERROR "VCPKG_PREFER_SYSTEM_LIBS check: failed (actual: ${VCPKG_PREFER_SYSTEM_LIBS}, but vcpkg paths are after system paths in CMAKE_PREFIX_PATH.)")
|
||||
else()
|
||||
message(STATUS "VCPKG_PREFER_SYSTEM_LIBS check: success (actual: ${VCPKG_PREFER_SYSTEM_LIBS})")
|
||||
endif()
|
||||
|
||||
# add_library overload
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib.c" "int lib_unused() { return 1; }")
|
||||
add_library(lib "${CMAKE_CURRENT_BINARY_DIR}/lib.c")
|
||||
|
||||
# add_executable overload
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/exe.c" "int main() { return 0; }")
|
||||
add_executable(exe "${CMAKE_CURRENT_BINARY_DIR}/exe.c")
|
||||
|
||||
# install overload
|
||||
set(X_VCPKG_APPLOCAL_DEPS_INSTALL 1)
|
||||
install(TARGETS exe lib
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
|
||||
# find_package overload and wrapper
|
||||
set(FIND_PACKAGES "" CACHE STRING "List of packages to be found and used")
|
||||
foreach(package ${FIND_PACKAGES})
|
||||
string(TOUPPER "${package}" package_upper)
|
||||
set(CMAKE_FIND_DEBUG_MODE ON)
|
||||
find_package("${package}" QUIET)
|
||||
set(CMAKE_FIND_DEBUG_MODE OFF)
|
||||
if(NOT ${package}_FOUND AND NOT ${package_upper}_FOUND)
|
||||
message(SEND_ERROR "find_package(${package}) check: failed")
|
||||
continue()
|
||||
endif()
|
||||
# REQUIRED changes the behaviour find_package_handle_standard_args.
|
||||
find_package("${package}" REQUIRED)
|
||||
message(STATUS "find_package(${package}) check: success")
|
||||
|
||||
set(libraries_var "")
|
||||
if(DEFINED ${package}_LIBRARIES)
|
||||
set(libraries_var "${package}_LIBRARIES")
|
||||
elseif(DEFINED ${package_upper}_LIBRARIES)
|
||||
set(libraries_var "${package_upper}_LIBRARIES")
|
||||
elseif(DEFINED ${package}_LIBRARY)
|
||||
set(libraries_var "${package}_LIBRARY")
|
||||
elseif(DEFINED ${package_upper}_LIBRARY)
|
||||
set(libraries_var "${package_upper}_LIBRARY")
|
||||
else()
|
||||
message(STATUS "${package}_LIBRARY/IES: undefined")
|
||||
continue()
|
||||
endif()
|
||||
set(libraries "${${libraries_var}}")
|
||||
message(STATUS "${libraries_var}: ${libraries}")
|
||||
|
||||
if(package STREQUAL "Intl" AND NOT Intl_LIBRARY)
|
||||
continue() # using libintl.h from C runtime library
|
||||
endif()
|
||||
target_link_libraries(exe PRIVATE ${libraries})
|
||||
|
||||
set(last_keyword "")
|
||||
foreach(item IN LISTS libraries)
|
||||
if(item STREQUAL "optimized" OR item STREQUAL "debug")
|
||||
set(last_keyword "${item}")
|
||||
continue()
|
||||
endif()
|
||||
string(FIND "${item}" "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/" starts_with_release)
|
||||
string(FIND "${item}" "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/" starts_with_debug)
|
||||
if(starts_with_release EQUAL "0")
|
||||
if(last_keyword STREQUAL "optimized")
|
||||
# okay
|
||||
elseif(last_keyword STREQUAL "debug")
|
||||
message(SEND_ERROR "Release lib for 'debug' keyword: ${item}")
|
||||
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
message(SEND_ERROR "Release lib for 'Debug' build: ${item}")
|
||||
endif()
|
||||
elseif(starts_with_debug EQUAL "0")
|
||||
if(last_keyword STREQUAL "debug")
|
||||
# okay
|
||||
elseif(last_keyword STREQUAL "optimized")
|
||||
message(SEND_ERROR "Debug lib for 'optimized' keyword: ${item}")
|
||||
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
message(SEND_ERROR "Debug lib for 'Release' build: ${item}")
|
||||
endif()
|
||||
endif()
|
||||
set(last_keyword "")
|
||||
continue()
|
||||
endforeach()
|
||||
endforeach()
|
96
externals/vcpkg/scripts/test_ports/cmake-user/vcpkg.json
vendored
Executable file
96
externals/vcpkg/scripts/test_ports/cmake-user/vcpkg.json
vendored
Executable file
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"name": "cmake-user",
|
||||
"version-date": "2022-04-18",
|
||||
"description": "Test port to verify the vcpkg toolchain in cmake user projects",
|
||||
"license": "MIT",
|
||||
"default-features": [
|
||||
"ci"
|
||||
],
|
||||
"features": {
|
||||
"ci": {
|
||||
"description": "The CI set of features to test",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "cmake-user",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"cmake-current",
|
||||
"find-package"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "cmake-user",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"cmake-3-7"
|
||||
],
|
||||
"platform": "x64 & (windows | linux | osx) & !uwp"
|
||||
}
|
||||
]
|
||||
},
|
||||
"cmake-3-7": {
|
||||
"description": "Run the tests with CMake 3.7"
|
||||
},
|
||||
"cmake-current": {
|
||||
"description": "Run the tests with vcpkg's current version of CMake"
|
||||
},
|
||||
"find-package": {
|
||||
"description": "Ports to be tested via find_package($package)",
|
||||
"dependencies": [
|
||||
{
|
||||
"$package": "BZip2",
|
||||
"name": "bzip2"
|
||||
},
|
||||
{
|
||||
"$package": "CURL",
|
||||
"name": "curl"
|
||||
},
|
||||
{
|
||||
"$package": "EXPAT",
|
||||
"name": "expat"
|
||||
},
|
||||
{
|
||||
"$package": "Freetype",
|
||||
"name": "freetype"
|
||||
},
|
||||
{
|
||||
"$package": "Intl",
|
||||
"name": "gettext"
|
||||
},
|
||||
{
|
||||
"$package": "GIF",
|
||||
"name": "giflib"
|
||||
},
|
||||
{
|
||||
"$package": "ICU",
|
||||
"name": "icu"
|
||||
},
|
||||
{
|
||||
"$package": "JPEG",
|
||||
"name": "libjpeg-turbo"
|
||||
},
|
||||
{
|
||||
"$package": "LibLZMA",
|
||||
"name": "liblzma"
|
||||
},
|
||||
{
|
||||
"$package": "PNG",
|
||||
"name": "libpng"
|
||||
},
|
||||
{
|
||||
"$package": "TIFF",
|
||||
"name": "tiff"
|
||||
},
|
||||
{
|
||||
"$package": "wxWidgets",
|
||||
"name": "wxwidgets",
|
||||
"platform": "!linux"
|
||||
},
|
||||
{
|
||||
"$package": "ZLIB",
|
||||
"name": "zlib"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
79
externals/vcpkg/scripts/test_ports/cmake/portfile.cmake
vendored
Executable file
79
externals/vcpkg/scripts/test_ports/cmake/portfile.cmake
vendored
Executable file
@@ -0,0 +1,79 @@
|
||||
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
|
||||
vcpkg_from_gitlab(
|
||||
GITLAB_URL https://gitlab.kitware.com/
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO cmake/cmake
|
||||
REF
|
||||
8428e39ed9cddb3b7f1a6f7a58cb8617503183d2
|
||||
SHA512
|
||||
4a40656efe5854bd6b893d0b2b86eed5df42992d080edb9c0cb2da2c55ad8dd489a85072b138947933d94ef5ba90c7a59f0a4460e3722d0f898ceefbbf74d226
|
||||
HEAD_REF master
|
||||
)
|
||||
set(OPTIONS)
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP)
|
||||
list(APPEND OPTIONS "-DBUILD_CursesDialog=ON")
|
||||
else()
|
||||
list(APPEND OPTIONS "-DBUILD_CursesDialog=OFF")
|
||||
endif()
|
||||
|
||||
if(VCPKG_CROSSCOMPILING)
|
||||
list(APPEND OPTIONS "-DQt6CoreTools_DIR=${CURRENT_HOST_INSTALLED_DIR}/share/Qt6CoreTools")
|
||||
list(APPEND OPTIONS "-DQt6WidgetsTools_DIR=${CURRENT_HOST_INSTALLED_DIR}/share/Qt6WidgetsTools")
|
||||
list(APPEND OPTIONS "-DQt6GuiTools_DIR=${CURRENT_HOST_INSTALLED_DIR}/share/Qt6GuiTools")
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64 AND VCPKG_TARGET_IS_WINDOWS) # Remove if PR #16111 is merged
|
||||
list(APPEND OPTIONS -DCMAKE_CROSSCOMPILING=ON -DCMAKE_SYSTEM_PROCESSOR:STRING=ARM64 -DCMAKE_SYSTEM_NAME:STRING=Windows)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
||||
set(VCPKG_CXX_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_CXX_FLAGS}")
|
||||
set(VCPKG_C_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${OPTIONS}
|
||||
-DBUILD_TESTING=OFF
|
||||
#-DCMAKE_USE_SYSTEM_LIBRARIES=ON
|
||||
-DCMAKE_USE_SYSTEM_LIBARCHIVE=ON
|
||||
-DCMAKE_USE_SYSTEM_CURL=ON
|
||||
-DCMAKE_USE_SYSTEM_EXPAT=ON
|
||||
-DCMAKE_USE_SYSTEM_ZLIB=ON
|
||||
-DCMAKE_USE_SYSTEM_BZIP2=ON
|
||||
-DCMAKE_USE_SYSTEM_ZSTD=ON
|
||||
-DCMAKE_USE_SYSTEM_FORM=ON
|
||||
-DCMAKE_USE_SYSTEM_JSONCPP=ON
|
||||
-DCMAKE_USE_SYSTEM_LIBRHASH=OFF # not yet in VCPKG
|
||||
-DCMAKE_USE_SYSTEM_LIBUV=ON
|
||||
-DBUILD_QtDialog=ON # Just to test Qt with CMake
|
||||
-DCMake_QT_MAJOR_VERSION:STRING=6
|
||||
)
|
||||
|
||||
vcpkg_cmake_install(ADD_BIN_TO_PATH)
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
if(NOT VCPKG_TARGET_IS_OSX)
|
||||
set(_tools cmake cmake-gui ctest cpack)
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
list(APPEND _tools cmcldeps)
|
||||
endif()
|
||||
if(BUILD_CURSES_DIALOG)
|
||||
list(APPEND _tools ccmake)
|
||||
endif()
|
||||
vcpkg_copy_tools(TOOL_NAMES ${_tools} AUTO_CLEAN)
|
||||
else()
|
||||
# On OSX everything is within a CMake.app folder
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/CMake.app")
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/CMake.app")
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/debug")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/debug/CMake.app")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
|
||||
|
||||
# Handle copyright
|
||||
configure_file("${SOURCE_PATH}/Copyright.txt" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
|
28
externals/vcpkg/scripts/test_ports/cmake/vcpkg.json
vendored
Executable file
28
externals/vcpkg/scripts/test_ports/cmake/vcpkg.json
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "cmake",
|
||||
"version-string": "3.22.2",
|
||||
"description": "CMake is an open-source, cross-platform family of tools designed to build, test and package software.",
|
||||
"homepage": "https://cmake.org/",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": [
|
||||
"bzip2",
|
||||
"curl",
|
||||
"expat",
|
||||
"jsoncpp",
|
||||
"libarchive",
|
||||
"liblzma",
|
||||
"libuv",
|
||||
{
|
||||
"name": "ncurses",
|
||||
"platform": "!(windows | uwp)"
|
||||
},
|
||||
"nghttp2",
|
||||
"qtbase",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
"zlib",
|
||||
"zstd"
|
||||
]
|
||||
}
|
1
externals/vcpkg/scripts/test_ports/llfio-run-tests/portfile.cmake
vendored
Executable file
1
externals/vcpkg/scripts/test_ports/llfio-run-tests/portfile.cmake
vendored
Executable file
@@ -0,0 +1 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
22
externals/vcpkg/scripts/test_ports/llfio-run-tests/vcpkg.json
vendored
Executable file
22
externals/vcpkg/scripts/test_ports/llfio-run-tests/vcpkg.json
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "llfio-run-tests",
|
||||
"version-string": "0",
|
||||
"port-version": 1,
|
||||
"description": "Ensures that LLFIO built with vcpkg version of dependencies produces working executables.",
|
||||
"supports": "x64",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "llfio",
|
||||
"features": [
|
||||
"run-tests"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "llfio",
|
||||
"features": [
|
||||
"run-tests",
|
||||
"status-code"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
1
externals/vcpkg/scripts/test_ports/outcome-run-tests/portfile.cmake
vendored
Executable file
1
externals/vcpkg/scripts/test_ports/outcome-run-tests/portfile.cmake
vendored
Executable file
@@ -0,0 +1 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
15
externals/vcpkg/scripts/test_ports/outcome-run-tests/vcpkg.json
vendored
Executable file
15
externals/vcpkg/scripts/test_ports/outcome-run-tests/vcpkg.json
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "outcome-run-tests",
|
||||
"version-string": "0",
|
||||
"port-version": 1,
|
||||
"description": "Ensures that outcome built with vcpkg version of dependencies produces working executables.",
|
||||
"supports": "x64",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "outcome",
|
||||
"features": [
|
||||
"run-tests"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
153
externals/vcpkg/scripts/test_ports/unit-test-cmake/portfile.cmake
vendored
Executable file
153
externals/vcpkg/scripts/test_ports/unit-test-cmake/portfile.cmake
vendored
Executable file
@@ -0,0 +1,153 @@
|
||||
function(set_fatal_error err)
|
||||
set(Z_VCPKG_UNIT_TEST_HAS_FATAL_ERROR "ON" CACHE BOOL "" FORCE)
|
||||
set(Z_VCPKG_UNIT_TEST_FATAL_ERROR "${err}" CACHE STRING "" FORCE)
|
||||
endfunction()
|
||||
function(unset_fatal_error)
|
||||
set(Z_VCPKG_UNIT_TEST_HAS_FATAL_ERROR "OFF" CACHE BOOL "" FORCE)
|
||||
endfunction()
|
||||
function(set_has_error)
|
||||
set(Z_VCPKG_UNIT_TEST_HAS_ERROR ON CACHE BOOL "" FORCE)
|
||||
endfunction()
|
||||
|
||||
macro(message level msg)
|
||||
if("${level}" STREQUAL "FATAL_ERROR")
|
||||
set_fatal_error("${msg}")
|
||||
return()
|
||||
else()
|
||||
_message("${level}" "${msg}") # note: this results in incorrect printing, but that's fine
|
||||
# message(STATUS "\${asdf}") will result in
|
||||
# message(STATUS "${asdf}"), since that's how macro arguments work.
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
set(Z_VCPKG_UNIT_TEST_HAS_ERROR OFF CACHE BOOL "" FORCE)
|
||||
unset_fatal_error()
|
||||
|
||||
# in order to allow namespacing
|
||||
function(unit_test_match namespace value regex)
|
||||
if("${value}" MATCHES "${regex}")
|
||||
set("${namespace}_MATCHED" ON PARENT_SCOPE)
|
||||
if("${CMAKE_MATCH_COUNT}" EQUAL "0")
|
||||
return()
|
||||
endif()
|
||||
|
||||
foreach(match RANGE 1 "${CMAKE_MATCH_COUNT}")
|
||||
set("${namespace}_CMAKE_MATCH_${match}" "${CMAKE_MATCH_${match}}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
else()
|
||||
set("${namespace}_MATCHED" OFF PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(unit_test_check_variable_unset utcvu_test utcvu_variable)
|
||||
cmake_language(EVAL CODE "${utcvu_test}")
|
||||
if(Z_VCPKG_UNIT_TEST_HAS_FATAL_ERROR)
|
||||
unset_fatal_error()
|
||||
set_has_error()
|
||||
message(STATUS "${utcvu_test} had an unexpected FATAL_ERROR;
|
||||
expected: \"${utcvu_value}\"")
|
||||
message(STATUS "FATAL_ERROR: ${Z_VCPKG_UNIT_TEST_FATAL_ERROR}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
unit_test_match(utcvu "${utcvu_variable}" [[^(ENV|CACHE)\{(.*)\}$]])
|
||||
if(utcvu_MATCHED)
|
||||
message(STATUS "utcvu_variable: ${utcvu_CMAKE_MATCH_2}")
|
||||
if("${utcvu_CMAKE_MATCH_1}" STREQUAL "ENV")
|
||||
set(utcvu_actual_value "$ENV{${utcvu_CMAKE_MATCH_2}}")
|
||||
elseif("${utcvu_CMAKE_MATCH_1}" STREQUAL "CACHE")
|
||||
set(utcvu_actual_value "$CACHE{${utcvu_CMAKE_MATCH_2}}")
|
||||
else()
|
||||
_message(FATAL_ERROR "unexpected value for CMAKE_MATCH_1: ${utcvu_CMAKE_MATCH_1}")
|
||||
endif()
|
||||
else()
|
||||
set(utcvu_actual_value "${${utcvu_variable}}")
|
||||
endif()
|
||||
|
||||
if(DEFINED "${utcvu_variable}")
|
||||
message(STATUS "${utcvu_test} set ${utcvu_variable};
|
||||
expected: \"${utcvu_variable}\" unset
|
||||
actual : \"${utcvu_actual_value}\"")
|
||||
set_has_error()
|
||||
return()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(unit_test_check_variable_equal utcve_test utcve_variable utcve_value)
|
||||
cmake_language(EVAL CODE "${utcve_test}")
|
||||
if(Z_VCPKG_UNIT_TEST_HAS_FATAL_ERROR)
|
||||
unset_fatal_error()
|
||||
set_has_error()
|
||||
message(STATUS "${utcve_test} had an unexpected FATAL_ERROR;
|
||||
expected: \"${utcve_value}\"")
|
||||
message(STATUS "FATAL_ERROR: ${Z_VCPKG_UNIT_TEST_FATAL_ERROR}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED "${utcve_variable}" AND NOT "${utcve_variable}" MATCHES "^ENV\\{")
|
||||
message(STATUS "${utcve_test} failed to set ${utcve_variable};
|
||||
expected: \"${utcve_value}\"")
|
||||
set_has_error()
|
||||
return()
|
||||
endif()
|
||||
|
||||
unit_test_match(utcve "${utcve_variable}" [[^(ENV|CACHE)\{(.*)\}$]])
|
||||
if(utcve_MATCHED)
|
||||
if("${utcve_CMAKE_MATCH_1}" STREQUAL "ENV")
|
||||
set(utcve_actual_value "$ENV{${utcve_CMAKE_MATCH_2}}")
|
||||
elseif("${utcve_CMAKE_MATCH_1}" STREQUAL "CACHE")
|
||||
set(utcve_actual_value "$CACHE{${utcve_CMAKE_MATCH_2}}")
|
||||
else()
|
||||
_message(FATAL_ERROR "unexpected value for CMAKE_MATCH_1: ${utcve_CMAKE_MATCH_1}")
|
||||
endif()
|
||||
else()
|
||||
set(utcve_actual_value "${${utcve_variable}}")
|
||||
endif()
|
||||
|
||||
if(NOT "${utcve_actual_value}" STREQUAL "${utcve_value}")
|
||||
message(STATUS "${utcve_test} resulted in the wrong value for ${utcve_variable};
|
||||
expected: \"${utcve_value}\"
|
||||
actual : \"${utcve_actual_value}\"")
|
||||
set_has_error()
|
||||
return()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(unit_test_ensure_success utcve_test)
|
||||
cmake_language(EVAL CODE "${utcve_test}")
|
||||
if(Z_VCPKG_UNIT_TEST_HAS_FATAL_ERROR)
|
||||
set_has_error()
|
||||
message(STATUS "${utcve_test} was expected to be successful.")
|
||||
endif()
|
||||
unset_fatal_error()
|
||||
endfunction()
|
||||
function(unit_test_ensure_fatal_error utcve_test)
|
||||
cmake_language(EVAL CODE "${utcve_test}")
|
||||
if(NOT Z_VCPKG_UNIT_TEST_HAS_FATAL_ERROR)
|
||||
set_has_error()
|
||||
message(STATUS "${utcve_test} was expected to be a FATAL_ERROR.")
|
||||
endif()
|
||||
unset_fatal_error()
|
||||
endfunction()
|
||||
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
if("minimum-required" IN_LIST FEATURES)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/test-vcpkg_minimum_required.cmake")
|
||||
endif()
|
||||
if("list" IN_LIST FEATURES)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/test-vcpkg_list.cmake")
|
||||
endif()
|
||||
if("host-path-list" IN_LIST FEATURES)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/test-vcpkg_host_path_list.cmake")
|
||||
endif()
|
||||
if("function-arguments" IN_LIST FEATURES)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/test-z_vcpkg_function_arguments.cmake")
|
||||
endif()
|
||||
if("merge-libs" IN_LIST FEATURES)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/test-z_vcpkg_cmake_config_fixup_merge.cmake")
|
||||
endif()
|
||||
|
||||
if(Z_VCPKG_UNIT_TEST_HAS_ERROR)
|
||||
_message(FATAL_ERROR "At least one test failed")
|
||||
endif()
|
281
externals/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_host_path_list.cmake
vendored
Executable file
281
externals/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_host_path_list.cmake
vendored
Executable file
@@ -0,0 +1,281 @@
|
||||
# CACHE{var} is a fatal error
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(APPEND CACHE{var})]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(PREPEND CACHE{var})]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(APPEND CACHE{var} c d)]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(PREPEND CACHE{var} c d)]])
|
||||
|
||||
# regular variable, HOST_PATH_SEPARATOR = ';'
|
||||
set(VCPKG_HOST_PATH_SEPARATOR ";")
|
||||
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(APPEND var "a;b")]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(PREPEND var "a;b")]])
|
||||
|
||||
set(var "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND var d e)]]
|
||||
var "a;b;d;e"
|
||||
)
|
||||
set(var "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND var)]]
|
||||
var "a;b"
|
||||
)
|
||||
set(var "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND var d e)]]
|
||||
var "d;e;a;b"
|
||||
)
|
||||
set(var "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND var)]]
|
||||
var "a;b"
|
||||
)
|
||||
|
||||
set(var "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND var d e)]]
|
||||
var "d;e"
|
||||
)
|
||||
set(var "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND var)]]
|
||||
var ""
|
||||
)
|
||||
set(var "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND var d e)]]
|
||||
var "d;e"
|
||||
)
|
||||
set(var "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND var)]]
|
||||
var ""
|
||||
)
|
||||
|
||||
unset(var)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND var d e)]]
|
||||
var "d;e"
|
||||
)
|
||||
unset(var)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND var)]]
|
||||
var ""
|
||||
)
|
||||
unset(var)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND var d e)]]
|
||||
var "d;e"
|
||||
)
|
||||
unset(var)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND var)]]
|
||||
var ""
|
||||
)
|
||||
|
||||
# regular variable, HOST_PATH_SEPARATOR = ':'
|
||||
set(VCPKG_HOST_PATH_SEPARATOR ":")
|
||||
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(APPEND var "a:b")]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(PREPEND var "a:b")]])
|
||||
|
||||
set(ENV{var} "a:b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var} d e)]]
|
||||
ENV{var} "a:b:d:e"
|
||||
)
|
||||
set(ENV{var} "a:b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var})]]
|
||||
ENV{var} "a:b"
|
||||
)
|
||||
set(ENV{var} "a:b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var} d e)]]
|
||||
ENV{var} "d:e:a:b"
|
||||
)
|
||||
set(ENV{var} "a:b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var})]]
|
||||
ENV{var} "a:b"
|
||||
)
|
||||
|
||||
set(ENV{var} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var} d e)]]
|
||||
ENV{var} "d:e"
|
||||
)
|
||||
set(ENV{var} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var})]]
|
||||
ENV{var} ""
|
||||
)
|
||||
set(ENV{var} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var} d e)]]
|
||||
ENV{var} "d:e"
|
||||
)
|
||||
set(ENV{var} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var})]]
|
||||
ENV{var} ""
|
||||
)
|
||||
|
||||
unset(ENV{var})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var} d e)]]
|
||||
ENV{var} "d:e"
|
||||
)
|
||||
unset(ENV{var})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var})]]
|
||||
ENV{var} ""
|
||||
)
|
||||
unset(ENV{var})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var} d e)]]
|
||||
ENV{var} "d:e"
|
||||
)
|
||||
unset(ENV{var})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var})]]
|
||||
ENV{var} ""
|
||||
)
|
||||
|
||||
# environment ENV{var}iable, HOST_PATH_SEPARATOR = ';'
|
||||
set(VCPKG_HOST_PATH_SEPARATOR ";")
|
||||
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(APPEND ENV{ENV{var}} "a;b")]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(PREPEND ENV{ENV{var}} "a;b")]])
|
||||
|
||||
set(ENV{ENV{var}} "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{ENV{var}} d e)]]
|
||||
ENV{ENV{var}} "a;b;d;e"
|
||||
)
|
||||
set(ENV{ENV{var}} "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{ENV{var}})]]
|
||||
ENV{ENV{var}} "a;b"
|
||||
)
|
||||
set(ENV{ENV{var}} "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{ENV{var}} d e)]]
|
||||
ENV{ENV{var}} "d;e;a;b"
|
||||
)
|
||||
set(ENV{ENV{var}} "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{ENV{var}})]]
|
||||
ENV{ENV{var}} "a;b"
|
||||
)
|
||||
|
||||
set(ENV{ENV{var}} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{ENV{var}} d e)]]
|
||||
ENV{ENV{var}} "d;e"
|
||||
)
|
||||
set(ENV{ENV{var}} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{ENV{var}})]]
|
||||
ENV{ENV{var}} ""
|
||||
)
|
||||
set(ENV{ENV{var}} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{ENV{var}} d e)]]
|
||||
ENV{ENV{var}} "d;e"
|
||||
)
|
||||
set(ENV{ENV{var}} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var})]]
|
||||
ENV{ENV{var}} ""
|
||||
)
|
||||
|
||||
unset(ENV{ENV{var}})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{ENV{var}} d e)]]
|
||||
ENV{ENV{var}} "d;e"
|
||||
)
|
||||
unset(ENV{ENV{var}})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{ENV{var}})]]
|
||||
ENV{ENV{var}} ""
|
||||
)
|
||||
unset(ENV{ENV{var}})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{ENV{var}} d e)]]
|
||||
ENV{ENV{var}} "d;e"
|
||||
)
|
||||
unset(ENV{ENV{var}})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{ENV{var}})]]
|
||||
ENV{ENV{var}} ""
|
||||
)
|
||||
|
||||
# regular ENV{var}iable, HOST_PATH_SEPARATOR = ':'
|
||||
set(VCPKG_HOST_PATH_SEPARATOR ":")
|
||||
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(APPEND ENV{var} "a:b")]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_host_path_list(PREPEND ENV{var} "a:b")]])
|
||||
|
||||
set(ENV{var} "a:b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var} d e)]]
|
||||
ENV{var} "a:b:d:e"
|
||||
)
|
||||
set(ENV{var} "a:b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var})]]
|
||||
ENV{var} "a:b"
|
||||
)
|
||||
set(ENV{var} "a:b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var} d e)]]
|
||||
ENV{var} "d:e:a:b"
|
||||
)
|
||||
set(ENV{var} "a:b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var})]]
|
||||
ENV{var} "a:b"
|
||||
)
|
||||
|
||||
set(ENV{var} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var} d e)]]
|
||||
ENV{var} "d:e"
|
||||
)
|
||||
set(ENV{var} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var})]]
|
||||
ENV{var} ""
|
||||
)
|
||||
set(ENV{var} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var} d e)]]
|
||||
ENV{var} "d:e"
|
||||
)
|
||||
set(ENV{var} "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var})]]
|
||||
ENV{var} ""
|
||||
)
|
||||
|
||||
unset(ENV{var})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var} d e)]]
|
||||
ENV{var} "d:e"
|
||||
)
|
||||
unset(ENV{var})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(APPEND ENV{var})]]
|
||||
ENV{var} ""
|
||||
)
|
||||
unset(ENV{var})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var} d e)]]
|
||||
ENV{var} "d:e"
|
||||
)
|
||||
unset(ENV{var})
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_host_path_list(PREPEND ENV{var})]]
|
||||
ENV{var} ""
|
||||
)
|
813
externals/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_list.cmake
vendored
Executable file
813
externals/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_list.cmake
vendored
Executable file
@@ -0,0 +1,813 @@
|
||||
# vcpkg_list(SET <list> <elements>...)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SET lst)]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SET lst "")]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SET lst "" "")]]
|
||||
lst ";"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SET lst a)]]
|
||||
lst "a"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SET lst a b)]]
|
||||
lst "a;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SET lst "a;b")]]
|
||||
lst [[a\;b]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[=[vcpkg_list(SET lst "a;b" "c" [[d\;e]])]=]
|
||||
lst [[a\;b;c;d\\;e]]
|
||||
)
|
||||
|
||||
# vcpkg_list(LENGTH <list> <out-var>)
|
||||
set(lst [[]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(LENGTH lst out)]]
|
||||
out 0
|
||||
)
|
||||
set(lst [[;]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(LENGTH lst out)]]
|
||||
out 2
|
||||
)
|
||||
set(lst [[a]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(LENGTH lst out)]]
|
||||
out 1
|
||||
)
|
||||
set(lst [[a;b]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(LENGTH lst out)]]
|
||||
out 2
|
||||
)
|
||||
set(lst [[a\\;b]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(LENGTH lst out)]]
|
||||
out 1
|
||||
)
|
||||
set(lst [[a\;b;c\\;d]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(LENGTH lst out)]]
|
||||
out 2
|
||||
)
|
||||
|
||||
# vcpkg_list(GET <list> <element-index> <out-var>)
|
||||
set(lst "")
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(GET lst 0 out)]])
|
||||
|
||||
set(lst "a")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(GET lst 0 out)]]
|
||||
out "a"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(GET lst -1 out)]]
|
||||
out "a"
|
||||
)
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(GET lst 2 out)]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(GET lst -2 out)]])
|
||||
|
||||
set(lst ";b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(GET lst 0 out)]]
|
||||
out ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(GET lst -1 out)]]
|
||||
out "b"
|
||||
)
|
||||
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(GET lst 0 out)]]
|
||||
out "a"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(GET lst -1 out)]]
|
||||
out "b"
|
||||
)
|
||||
|
||||
set(lst [[a\;b;c]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(GET lst 0 out)]]
|
||||
out "a;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(GET lst -1 out)]]
|
||||
out "c"
|
||||
)
|
||||
|
||||
set(lst [[a;b\;c;d\\;e]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(GET lst 1 out)]]
|
||||
out "b;c"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(GET lst -1 out)]]
|
||||
out [[d\;e]]
|
||||
)
|
||||
|
||||
# vcpkg_list(JOIN <list> <glue> <out-var>)
|
||||
set(lst "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(JOIN lst "-" out)]]
|
||||
out ""
|
||||
)
|
||||
|
||||
set(lst "a")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(JOIN lst "-" out)]]
|
||||
out "a"
|
||||
)
|
||||
|
||||
set(lst ";")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(JOIN lst "-" out)]]
|
||||
out "-"
|
||||
)
|
||||
|
||||
set(lst [[a;b]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(JOIN lst "-" out)]]
|
||||
out [[a-b]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(JOIN lst "+" out)]]
|
||||
out [[a+b]]
|
||||
)
|
||||
|
||||
set(lst [[a;b\;c\\;d]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(JOIN lst "-" out)]]
|
||||
out [[a-b;c\;d]]
|
||||
)
|
||||
|
||||
# vcpkg_list(SUBLIST <list> <begin> <length> <out-var>)
|
||||
set(lst "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 0 0 out)]]
|
||||
out ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 0 1 out)]]
|
||||
out ""
|
||||
)
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(SUBLIST lst 1 0 out)]])
|
||||
|
||||
set(lst "a")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 0 0 out)]]
|
||||
out ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 0 1 out)]]
|
||||
out "a"
|
||||
)
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(SUBLIST lst 2 0 out)]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(SUBLIST lst 2 1 out)]])
|
||||
|
||||
set(lst ";;")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 0 0 out)]]
|
||||
out ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 0 1 out)]]
|
||||
out ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 0 2 out)]]
|
||||
out ";"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 0 3 out)]]
|
||||
out ";;"
|
||||
)
|
||||
|
||||
set(lst "a;b;c;d")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 1 2 out)]]
|
||||
out "b;c"
|
||||
)
|
||||
|
||||
set(lst [[a\;b;c\;d;e]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 1 2 out)]]
|
||||
out [[c\;d;e]]
|
||||
)
|
||||
|
||||
set(lst [[a\;b;c\\;d;e;f;g;h]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(SUBLIST lst 1 -1 out)]]
|
||||
out [[c\\;d;e;f;g;h]]
|
||||
)
|
||||
|
||||
# vcpkg_list(FIND <list> <value> <out-var>)
|
||||
set(lst "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(FIND lst "a" out)]]
|
||||
out -1
|
||||
)
|
||||
|
||||
set(lst "b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(FIND lst "a" out)]]
|
||||
out -1
|
||||
)
|
||||
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(FIND lst "a" out)]]
|
||||
out 0
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(FIND lst b out)]]
|
||||
out 1
|
||||
)
|
||||
|
||||
set(lst ";b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(FIND lst "" out)]]
|
||||
out 0
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(FIND lst b out)]]
|
||||
out 1
|
||||
)
|
||||
|
||||
set(lst [[a\;b;c]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(FIND lst "a;b" out)]]
|
||||
out 0
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(FIND lst c out)]]
|
||||
out 1
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(FIND lst a out)]]
|
||||
out -1
|
||||
)
|
||||
|
||||
set(lst [[a\\;b;c]])
|
||||
unit_test_check_variable_equal(
|
||||
[=[vcpkg_list(FIND lst [[a\;b]] out)]=]
|
||||
out 0
|
||||
)
|
||||
|
||||
# vcpkg_list(APPEND <list> [<element>...])
|
||||
set(lst "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst)]]
|
||||
lst [[]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst "")]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst "" "")]]
|
||||
lst ";"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst a)]]
|
||||
lst "a"
|
||||
)
|
||||
|
||||
set(lst ";")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst)]]
|
||||
lst ";"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst "")]]
|
||||
lst ";;"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst b)]]
|
||||
lst ";;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst "b;c" d)]]
|
||||
lst [[;;b\;c;d]]
|
||||
)
|
||||
|
||||
set(lst "a")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst)]]
|
||||
lst "a"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst "")]]
|
||||
lst "a;"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst b)]]
|
||||
lst "a;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst "b;c" d)]]
|
||||
lst [[a;b\;c;d]]
|
||||
)
|
||||
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst)]]
|
||||
lst "a;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst "")]]
|
||||
lst "a;b;"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst c)]]
|
||||
lst "a;b;c"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(APPEND lst "c;d" e)]]
|
||||
lst [[a;b;c\;d;e]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[=[vcpkg_list(APPEND lst [[c\;d]])]=]
|
||||
lst [[a;b;c\\;d]]
|
||||
)
|
||||
|
||||
# vcpkg_list(PREPEND <list> [<element>...])
|
||||
set(lst "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst)]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst "")]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst "" "")]]
|
||||
lst ";"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst a)]]
|
||||
lst "a"
|
||||
)
|
||||
|
||||
set(lst ";")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst)]]
|
||||
lst ";"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst "")]]
|
||||
lst ";;"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst b)]]
|
||||
lst "b;;"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst "b;c" d)]]
|
||||
lst [[b\;c;d;;]]
|
||||
)
|
||||
|
||||
set(lst "a")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst)]]
|
||||
lst "a"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst "")]]
|
||||
lst ";a"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst b)]]
|
||||
lst "b;a"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst "b;c" d)]]
|
||||
lst [[b\;c;d;a]]
|
||||
)
|
||||
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst)]]
|
||||
lst "a;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst "")]]
|
||||
lst ";a;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst c)]]
|
||||
lst "c;a;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(PREPEND lst "c;d" e)]]
|
||||
lst [[c\;d;e;a;b]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[=[vcpkg_list(PREPEND lst [[c\;d]])]=]
|
||||
lst [[c\\;d;a;b]]
|
||||
)
|
||||
|
||||
# list(INSERT <list> <index> [<element>...])
|
||||
set(lst "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 0)]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 0 "")]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 0 "" "")]]
|
||||
lst ";"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 0 "a")]]
|
||||
lst "a"
|
||||
)
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(INSERT lst 1 "")]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(INSERT lst -1 "")]])
|
||||
|
||||
set(lst ";")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 0)]]
|
||||
lst ";"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 1)]]
|
||||
lst ";"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 1 "")]]
|
||||
lst ";;"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 0 b)]]
|
||||
lst "b;;"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 1 b)]]
|
||||
lst ";b;"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 2 b)]]
|
||||
lst ";;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst -1 "b;c" d)]]
|
||||
lst [[;b\;c;d;]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst -2 "b;c" d)]]
|
||||
lst [[b\;c;d;;]]
|
||||
)
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(INSERT lst 3 "")]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(INSERT lst -3 "")]])
|
||||
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst -1 c)]]
|
||||
lst "a;c;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 1 c)]]
|
||||
lst "a;c;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 2 c)]]
|
||||
lst "a;b;c"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst -2 c)]]
|
||||
lst "c;a;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(INSERT lst 1 "c;d")]]
|
||||
lst [[a;c\;d;b]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[=[vcpkg_list(INSERT lst 1 [[c\;d]] e)]=]
|
||||
lst [[a;c\\;d;e;b]]
|
||||
)
|
||||
|
||||
# vcpkg_list(POP_BACK <list>)
|
||||
set(lst "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_BACK lst)]]
|
||||
lst ""
|
||||
)
|
||||
|
||||
set(lst ";")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_BACK lst)]]
|
||||
lst ""
|
||||
)
|
||||
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_BACK lst)]]
|
||||
lst "a"
|
||||
)
|
||||
|
||||
set(lst "a;;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_BACK lst)]]
|
||||
lst "a;"
|
||||
)
|
||||
|
||||
set(lst [[a\;b]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_BACK lst)]]
|
||||
lst ""
|
||||
)
|
||||
|
||||
set(lst [[c;a\;b;c]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_BACK lst)]]
|
||||
lst [[c;a\;b]]
|
||||
)
|
||||
|
||||
# vcpkg_list(POP_FRONT <list>)
|
||||
set(lst "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_BACK lst)]]
|
||||
lst ""
|
||||
)
|
||||
|
||||
set(lst ";")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_FRONT lst)]]
|
||||
lst ""
|
||||
)
|
||||
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_FRONT lst)]]
|
||||
lst "b"
|
||||
)
|
||||
|
||||
set(lst "a;;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_FRONT lst)]]
|
||||
lst ";b"
|
||||
)
|
||||
|
||||
set(lst [[a\;b]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_FRONT lst)]]
|
||||
lst ""
|
||||
)
|
||||
|
||||
set(lst [[c;a\;b;c]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(POP_FRONT lst)]]
|
||||
lst [[a\;b;c]]
|
||||
)
|
||||
|
||||
# vcpkg_list(REMOVE_DUPLICATES <list>)
|
||||
set(lst ";")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_DUPLICATES lst)]]
|
||||
lst ""
|
||||
)
|
||||
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_DUPLICATES lst)]]
|
||||
lst "a;b"
|
||||
)
|
||||
|
||||
set(lst "a;a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_DUPLICATES lst)]]
|
||||
lst "a;b"
|
||||
)
|
||||
|
||||
set(lst "a;b;a")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_DUPLICATES lst)]]
|
||||
lst "a;b"
|
||||
)
|
||||
|
||||
set(lst "c;a;b;a;c")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_DUPLICATES lst)]]
|
||||
lst "c;a;b"
|
||||
)
|
||||
|
||||
set(lst "a;;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_DUPLICATES lst)]]
|
||||
lst "a;;b"
|
||||
)
|
||||
|
||||
set(lst [[a\;b;a\;b]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_DUPLICATES lst)]]
|
||||
lst [[a\;b]]
|
||||
)
|
||||
|
||||
set(lst [[c;a\;b;c]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_DUPLICATES lst)]]
|
||||
lst [[c;a\;b]]
|
||||
)
|
||||
|
||||
# vcpkg_list(REVERSE <list>)
|
||||
set(lst "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REVERSE lst)]]
|
||||
lst ""
|
||||
)
|
||||
set(lst ";")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REVERSE lst)]]
|
||||
lst ";"
|
||||
)
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REVERSE lst)]]
|
||||
lst "b;a"
|
||||
)
|
||||
set(lst "a;b;c;d;e;f;g")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REVERSE lst)]]
|
||||
lst "g;f;e;d;c;b;a"
|
||||
)
|
||||
|
||||
set(lst [[a\;b;a\;b\\;c]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REVERSE lst)]]
|
||||
lst [[a\;b\\;c;a\;b]]
|
||||
)
|
||||
set(lst [[c;a\;b]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REVERSE lst)]]
|
||||
lst [[a\;b;c]]
|
||||
)
|
||||
|
||||
# vcpkg_list(REMOVE_ITEM <list> <value>)
|
||||
set(lst "")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst "a")]]
|
||||
lst ""
|
||||
)
|
||||
|
||||
set(lst ";")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst "")]]
|
||||
lst ""
|
||||
)
|
||||
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst a)]]
|
||||
lst "b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst b)]]
|
||||
lst "a"
|
||||
)
|
||||
|
||||
set(lst "a;a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst a)]]
|
||||
lst "b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst b)]]
|
||||
lst "a;a"
|
||||
)
|
||||
|
||||
set(lst "a;b;c;a;d")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst b)]]
|
||||
lst "a;c;a;d"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst a)]]
|
||||
lst "b;c;d"
|
||||
)
|
||||
|
||||
set(lst "a;;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst "")]]
|
||||
lst "a;b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst a)]]
|
||||
lst ";b"
|
||||
)
|
||||
|
||||
set(lst [[e;a\;b;c\;d]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst "a;b")]]
|
||||
lst [[e;c\;d]]
|
||||
)
|
||||
|
||||
set(lst [[c;a\;b;c]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst "c")]]
|
||||
lst [[a\;b]]
|
||||
)
|
||||
|
||||
set(lst [[c;a\\;b;c]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_ITEM lst "a\\;b")]]
|
||||
lst [[c;c]]
|
||||
)
|
||||
|
||||
# vcpkg_list(REMOVE_AT <list> <index>)
|
||||
set(lst "")
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(REMOVE_AT lst 0)]])
|
||||
|
||||
set(lst ";")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 0)]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 1)]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst -1)]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst -2)]]
|
||||
lst ""
|
||||
)
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(REMOVE_AT lst 2)]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_list(REMOVE_AT lst -3)]])
|
||||
|
||||
set(lst "a;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 0)]]
|
||||
lst "b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 1)]]
|
||||
lst "a"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst -1)]]
|
||||
lst "a"
|
||||
)
|
||||
|
||||
set(lst "a;;b")
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 0)]]
|
||||
lst ";b"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 1)]]
|
||||
lst "a;b"
|
||||
)
|
||||
|
||||
set(lst [[e;a\;b;c\;d]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 0)]]
|
||||
lst [[a\;b;c\;d]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 1)]]
|
||||
lst [[e;c\;d]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst -1)]]
|
||||
lst [[e;a\;b]]
|
||||
)
|
||||
|
||||
set(lst [[c;a\\;b;c\;d;e]])
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 0)]]
|
||||
lst [[a\\;b;c\;d;e]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 1)]]
|
||||
lst [[c;c\;d;e]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 2)]]
|
||||
lst [[c;a\\;b;e]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst 3)]]
|
||||
lst [[c;a\\;b;c\;d]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[vcpkg_list(REMOVE_AT lst -1)]]
|
||||
lst [[c;a\\;b;c\;d]]
|
||||
)
|
49
externals/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_minimum_required.cmake
vendored
Executable file
49
externals/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_minimum_required.cmake
vendored
Executable file
@@ -0,0 +1,49 @@
|
||||
# -- error cases --
|
||||
# VCPKG_BASE_VERSION not set - vcpkg version is too old
|
||||
set(VCPKG_BASE_VERSION_backup "${VCPKG_BASE_VERSION}")
|
||||
unset(VCPKG_BASE_VERSION)
|
||||
unset(VCPKG_BASE_VERSION CACHE)
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021-01-01)]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required()]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION "")]])
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION "2021.01.01")]])
|
||||
|
||||
set(VCPKG_BASE_VERSION 2021-02-02)
|
||||
|
||||
# VERSION not passed
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required()]])
|
||||
# VERSION weird - empty
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION "")]])
|
||||
# VERSION weird - dotted
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021.01.01)]])
|
||||
# VERSION weird - not a valid year
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 3000-01-01)]])
|
||||
# VERSION weird - list
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION "2021-01-01;2021-01-02")]])
|
||||
# VERSION weird - small year
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 21-01-01)]])
|
||||
# VERSION weird - small month
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021-1-01)]])
|
||||
# VERSION weird - small day
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021-01-1)]])
|
||||
# VERSION too-new - later year, earlier month, earlier day
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2022-01-01)]])
|
||||
# VERSION too-new - same year, later month, earlier day
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021-03-01)]])
|
||||
# VERSION too-new - same year, same month, later day
|
||||
unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021-02-03)]])
|
||||
|
||||
# -- successes --
|
||||
# same date
|
||||
unit_test_ensure_success([[vcpkg_minimum_required(VERSION 2021-02-02)]])
|
||||
|
||||
# VERSION old - earlier year, later month, later day
|
||||
unit_test_ensure_success([[vcpkg_minimum_required(VERSION 2020-03-03)]])
|
||||
# VERSION old - same year, earlier month, later day
|
||||
unit_test_ensure_success([[vcpkg_minimum_required(VERSION 2021-01-03)]])
|
||||
# VERSION old - same year, same month, earlier day
|
||||
unit_test_ensure_success([[vcpkg_minimum_required(VERSION 2021-02-01)]])
|
||||
|
||||
# reset to backup
|
||||
unset(VCPKG_BASE_VERSION)
|
||||
set(VCPKG_BASE_VERSION "${VCPKG_BASE_VERSION_backup}" CACHE STRING "")
|
56
externals/vcpkg/scripts/test_ports/unit-test-cmake/test-z_vcpkg_cmake_config_fixup_merge.cmake
vendored
Executable file
56
externals/vcpkg/scripts/test_ports/unit-test-cmake/test-z_vcpkg_cmake_config_fixup_merge.cmake
vendored
Executable file
@@ -0,0 +1,56 @@
|
||||
# z_vcpkg_cmake_config_fixup_merge(<out_list> <release_list> <debug_list>)
|
||||
set(release_libs namespace::C++_shared)
|
||||
set(debug_libs namespace::C++_shared)
|
||||
unit_test_check_variable_equal(
|
||||
[[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]]
|
||||
merged "namespace::C++_shared"
|
||||
)
|
||||
|
||||
set(release_libs A)
|
||||
set(debug_libs B)
|
||||
unit_test_check_variable_equal(
|
||||
[[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]]
|
||||
merged [[\$<\$<NOT:\$<CONFIG:DEBUG>>:A>;\$<\$<CONFIG:DEBUG>:B>]]
|
||||
)
|
||||
|
||||
set(release_libs A B)
|
||||
set(debug_libs A )
|
||||
unit_test_check_variable_equal(
|
||||
[[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]]
|
||||
merged [[A;\$<\$<NOT:\$<CONFIG:DEBUG>>:B>]]
|
||||
)
|
||||
|
||||
set(release_libs A )
|
||||
set(debug_libs A B)
|
||||
unit_test_check_variable_equal(
|
||||
[[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]]
|
||||
merged [[A;\$<\$<CONFIG:DEBUG>:B>]]
|
||||
)
|
||||
|
||||
set(release_libs A C)
|
||||
set(debug_libs C)
|
||||
unit_test_check_variable_equal(
|
||||
[[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]]
|
||||
merged [[\$<\$<NOT:\$<CONFIG:DEBUG>>:A>;\$<\$<CONFIG:DEBUG>:C>;\$<\$<NOT:\$<CONFIG:DEBUG>>:C>]]
|
||||
)
|
||||
|
||||
set(release_libs [[\$<\$<NOT:\$<CONFIG:DEBUG>>:A>;\$<\$<CONFIG:DEBUG>:B>]])
|
||||
set(debug_libs [[\$<\$<NOT:\$<CONFIG:DEBUG>>:A>;\$<\$<CONFIG:DEBUG>:B>]])
|
||||
unit_test_check_variable_equal(
|
||||
[[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]]
|
||||
merged [[\$<\$<NOT:\$<CONFIG:DEBUG>>:A>;\$<\$<CONFIG:DEBUG>:B>]]
|
||||
)
|
||||
|
||||
set(release_libs optimized o1 debug d1)
|
||||
set(debug_libs optimized o2 debug d2)
|
||||
unit_test_check_variable_equal(
|
||||
[[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]]
|
||||
merged [[\$<\$<NOT:\$<CONFIG:DEBUG>>:o1>;\$<\$<CONFIG:DEBUG>:d2>]]
|
||||
)
|
||||
|
||||
set(release_libs debug d1 optimized o1)
|
||||
set(debug_libs debug d2 optimized o2)
|
||||
unit_test_check_variable_equal(
|
||||
[[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]]
|
||||
merged [[\$<\$<CONFIG:DEBUG>:d2>;\$<\$<NOT:\$<CONFIG:DEBUG>>:o1>]]
|
||||
)
|
63
externals/vcpkg/scripts/test_ports/unit-test-cmake/test-z_vcpkg_function_arguments.cmake
vendored
Executable file
63
externals/vcpkg/scripts/test_ports/unit-test-cmake/test-z_vcpkg_function_arguments.cmake
vendored
Executable file
@@ -0,0 +1,63 @@
|
||||
# these both set `args` in the top level
|
||||
function(check_function_args start)
|
||||
z_vcpkg_function_arguments(out "${start}")
|
||||
set(args "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
function(check_all_function_args)
|
||||
z_vcpkg_function_arguments(out)
|
||||
set(args "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
unit_test_ensure_fatal_error([[check_function_args(-1)]])
|
||||
unit_test_ensure_fatal_error([[check_function_args(3)]])
|
||||
unit_test_ensure_fatal_error([[check_function_args(notanumber)]])
|
||||
unit_test_check_variable_equal(
|
||||
[[check_all_function_args()]]
|
||||
args ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[check_all_function_args("")]]
|
||||
args ""
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[check_all_function_args("" "")]]
|
||||
args ";"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[check_all_function_args("" "" "" "")]]
|
||||
args ";;;"
|
||||
)
|
||||
|
||||
unit_test_check_variable_equal(
|
||||
[[check_all_function_args(a b c)]]
|
||||
args "a;b;c"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[check_function_args(2 a b c)]]
|
||||
args "b;c"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[[check_function_args(3 a b c)]]
|
||||
args "c"
|
||||
)
|
||||
|
||||
unit_test_check_variable_equal(
|
||||
[=[check_all_function_args("a;b" [[c\;d]] e)]=]
|
||||
args [[a\;b;c\\;d;e]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[=[check_all_function_args("a;b" [[c\;d]] [[e\\;f]])]=]
|
||||
args [[a\;b;c\\;d;e\\\;f]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[=[check_function_args(2 "a;b" [[c\;d]] e)]=]
|
||||
args [[c\\;d;e]]
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[=[check_function_args(3 "a;b" [[c\;d]] e)]=]
|
||||
args "e"
|
||||
)
|
||||
unit_test_check_variable_equal(
|
||||
[=[check_function_args(4 "a;b" [[c\;d]] e)]=]
|
||||
args ""
|
||||
)
|
36
externals/vcpkg/scripts/test_ports/unit-test-cmake/vcpkg.json
vendored
Executable file
36
externals/vcpkg/scripts/test_ports/unit-test-cmake/vcpkg.json
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "unit-test-cmake",
|
||||
"version-string": "0",
|
||||
"description": "Ensures that the CMake scripts are unit tested.",
|
||||
"supports": "x64",
|
||||
"default-features": [
|
||||
"function-arguments",
|
||||
"host-path-list",
|
||||
"list",
|
||||
"merge-libs",
|
||||
"minimum-required"
|
||||
],
|
||||
"features": {
|
||||
"function-arguments": {
|
||||
"description": "Test the z_vcpkg_function_arguments function"
|
||||
},
|
||||
"host-path-list": {
|
||||
"description": "Test the vcpkg_host_path_list function"
|
||||
},
|
||||
"list": {
|
||||
"description": "Test the vcpkg_list function"
|
||||
},
|
||||
"merge-libs": {
|
||||
"description": "Test the z_vcpkg_cmake_config_fixup_merge_lists function",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"minimum-required": {
|
||||
"description": "Test the vcpkg_minimum_required function"
|
||||
}
|
||||
}
|
||||
}
|
3
externals/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/portfile.cmake
vendored
Executable file
3
externals/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/portfile.cmake
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
vcpkg_acquire_msys(MSYS_ROOT Z_ALL_PACKAGES)
|
7
externals/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/vcpkg.json
vendored
Executable file
7
externals/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/vcpkg.json
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "vcpkg-acquire-msys-test",
|
||||
"version-string": "0",
|
||||
"port-version": 1,
|
||||
"description": "Test port to exercise vcpkg_acquire_msys",
|
||||
"supports": "x86 & windows"
|
||||
}
|
1
externals/vcpkg/scripts/test_ports/vcpkg-ci-boost/portfile.cmake
vendored
Executable file
1
externals/vcpkg/scripts/test_ports/vcpkg-ci-boost/portfile.cmake
vendored
Executable file
@@ -0,0 +1 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
65
externals/vcpkg/scripts/test_ports/vcpkg-ci-boost/vcpkg.json
vendored
Executable file
65
externals/vcpkg/scripts/test_ports/vcpkg-ci-boost/vcpkg.json
vendored
Executable file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "vcpkg-ci-boost",
|
||||
"version": "1",
|
||||
"description": "Boost features testing within CI.",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "boost",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"mpi"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "boost-asio",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"ssl"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "boost-fiber",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"numa"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "boost-locale",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"icu"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "boost-mpi",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"python3"
|
||||
],
|
||||
"platform": "!static"
|
||||
},
|
||||
{
|
||||
"name": "boost-odeint",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"mpi"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "boost-python",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"python2",
|
||||
"python3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "boost-regex",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"icu"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
1
externals/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/portfile.cmake
vendored
Executable file
1
externals/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/portfile.cmake
vendored
Executable file
@@ -0,0 +1 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
145
externals/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/vcpkg.json
vendored
Executable file
145
externals/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/vcpkg.json
vendored
Executable file
@@ -0,0 +1,145 @@
|
||||
{
|
||||
"name": "vcpkg-ci-ffmpeg",
|
||||
"version-string": "1",
|
||||
"port-version": 1,
|
||||
"description": "Port to force features of certain ports within CI",
|
||||
"homepage": "https://github.com/microsoft/vcpkg",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"avcodec",
|
||||
"avdevice",
|
||||
"avfilter",
|
||||
"avformat",
|
||||
"avresample",
|
||||
"bzip2",
|
||||
"fdk-aac",
|
||||
"freetype",
|
||||
"gpl",
|
||||
"iconv",
|
||||
"lzma",
|
||||
"mp3lame",
|
||||
"nonfree",
|
||||
"openjpeg",
|
||||
"openssl",
|
||||
"opus",
|
||||
"postproc",
|
||||
"snappy",
|
||||
"soxr",
|
||||
"speex",
|
||||
"swresample",
|
||||
"swscale",
|
||||
"theora",
|
||||
"vorbis",
|
||||
"vpx",
|
||||
"webp",
|
||||
"xml2",
|
||||
"zlib"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"alsa"
|
||||
],
|
||||
"platform": "linux"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"sdl2"
|
||||
],
|
||||
"platform": "!osx"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"ass",
|
||||
"fontconfig",
|
||||
"fribidi",
|
||||
"modplug",
|
||||
"opencl",
|
||||
"openh264"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"ilbc"
|
||||
],
|
||||
"platform": "!(arm & uwp)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"ssh",
|
||||
"x265"
|
||||
],
|
||||
"platform": "!(uwp | arm)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"x264"
|
||||
],
|
||||
"platform": "!(arm & windows)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"aom"
|
||||
],
|
||||
"platform": "!(windows & arm & !uwp)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"dav1d"
|
||||
],
|
||||
"platform": "!(uwp | arm | x86 | osx)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"opengl"
|
||||
],
|
||||
"platform": "!uwp & !(arm64 & windows)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"avisynthplus"
|
||||
],
|
||||
"platform": "windows & !arm & !uwp & !static"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"tesseract"
|
||||
],
|
||||
"platform": "!(windows & arm) & !static & !uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"nvcodec"
|
||||
],
|
||||
"platform": "linux | (!osx & !uwp & !(arm64 & windows))"
|
||||
}
|
||||
]
|
||||
}
|
1
externals/vcpkg/scripts/test_ports/vcpkg-ci-llvm/portfile.cmake
vendored
Executable file
1
externals/vcpkg/scripts/test_ports/vcpkg-ci-llvm/portfile.cmake
vendored
Executable file
@@ -0,0 +1 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
47
externals/vcpkg/scripts/test_ports/vcpkg-ci-llvm/vcpkg.json
vendored
Executable file
47
externals/vcpkg/scripts/test_ports/vcpkg-ci-llvm/vcpkg.json
vendored
Executable file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "vcpkg-ci-llvm",
|
||||
"version-string": "0",
|
||||
"description": "LLVM features testing within CI.",
|
||||
"license": null,
|
||||
"supports": "!uwp & !(arm & windows)",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "llvm",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"bolt",
|
||||
"clang",
|
||||
"disable-assertions",
|
||||
"disable-clang-static-analyzer",
|
||||
"enable-abi-breaking-checks",
|
||||
"enable-bindings",
|
||||
"enable-eh",
|
||||
"enable-rtti",
|
||||
"enable-terminfo",
|
||||
"enable-threads",
|
||||
"enable-zlib",
|
||||
"lld",
|
||||
"lldb",
|
||||
"openmp",
|
||||
"polly",
|
||||
"target-aarch64",
|
||||
"target-amdgpu",
|
||||
"target-arm",
|
||||
"target-webassembly",
|
||||
"target-x86",
|
||||
"tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$comment": "Only for osx artifact upload in CI succeeds when these features are enabled",
|
||||
"name": "llvm",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"flang",
|
||||
"target-all",
|
||||
"utils"
|
||||
],
|
||||
"platform": "osx"
|
||||
}
|
||||
]
|
||||
}
|
1
externals/vcpkg/scripts/test_ports/vcpkg-ci-opencv/portfile.cmake
vendored
Executable file
1
externals/vcpkg/scripts/test_ports/vcpkg-ci-opencv/portfile.cmake
vendored
Executable file
@@ -0,0 +1 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
74
externals/vcpkg/scripts/test_ports/vcpkg-ci-opencv/vcpkg.json
vendored
Executable file
74
externals/vcpkg/scripts/test_ports/vcpkg-ci-opencv/vcpkg.json
vendored
Executable file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"name": "vcpkg-ci-opencv",
|
||||
"version-string": "1",
|
||||
"port-version": 5,
|
||||
"description": "Port to force features of certain ports within CI",
|
||||
"homepage": "https://github.com/microsoft/vcpkg",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "opencv",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"ade",
|
||||
"contrib",
|
||||
"dnn",
|
||||
"eigen",
|
||||
"ffmpeg",
|
||||
"jpeg",
|
||||
"nonfree",
|
||||
"png",
|
||||
"quirc",
|
||||
"tiff",
|
||||
"webp"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "opencv",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"gtk",
|
||||
"dc1394"
|
||||
],
|
||||
"platform": "linux"
|
||||
},
|
||||
{
|
||||
"name": "opencv",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"cuda",
|
||||
"cudnn",
|
||||
"gstreamer",
|
||||
"halide",
|
||||
"ovis",
|
||||
"tbb"
|
||||
],
|
||||
"platform": "windows & x64 & !static & !uwp"
|
||||
},
|
||||
{
|
||||
"name": "opencv",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"freetype",
|
||||
"gdcm",
|
||||
"ipp",
|
||||
"jasper",
|
||||
"lapack",
|
||||
"openexr",
|
||||
"opengl",
|
||||
"openmp",
|
||||
"qt",
|
||||
"sfm",
|
||||
"vtk"
|
||||
],
|
||||
"platform": "!uwp & !(windows & (arm | arm64))"
|
||||
},
|
||||
{
|
||||
"name": "opencv",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"python"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
}
|
||||
]
|
||||
}
|
1
externals/vcpkg/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake
vendored
Executable file
1
externals/vcpkg/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake
vendored
Executable file
@@ -0,0 +1 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
26
externals/vcpkg/scripts/test_ports/vcpkg-ci-paraview/vcpkg.json
vendored
Executable file
26
externals/vcpkg/scripts/test_ports/vcpkg-ci-paraview/vcpkg.json
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "vcpkg-ci-paraview",
|
||||
"version-string": "1",
|
||||
"port-version": 3,
|
||||
"description": "Port to force features of certain ports within CI",
|
||||
"homepage": "https://github.com/microsoft/vcpkg",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "paraview",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"tools"
|
||||
],
|
||||
"platform": "x86 & windows"
|
||||
},
|
||||
{
|
||||
"name": "paraview",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"tools",
|
||||
"vtkm"
|
||||
],
|
||||
"platform": "!(x86 & windows)"
|
||||
}
|
||||
]
|
||||
}
|
34
externals/vcpkg/scripts/test_ports/vcpkg-ci-wxwidgets/portfile.cmake
vendored
Executable file
34
externals/vcpkg/scripts/test_ports/vcpkg-ci-wxwidgets/portfile.cmake
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS OPTIONS
|
||||
FEATURES
|
||||
wxrc USE_WXRC
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${CURRENT_INSTALLED_DIR}/share/wxwidgets/example"
|
||||
DISABLE_PARALLEL_CONFIGURE # Need separate dbg log for following test
|
||||
OPTIONS
|
||||
${OPTIONS}
|
||||
-DCMAKE_CONFIG_RUN=1
|
||||
"-DPRINT_VARS=CMAKE_CONFIG_RUN;wxWidgets_LIBRARIES"
|
||||
)
|
||||
vcpkg_cmake_build()
|
||||
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
# Check that debug libs are still used after re-configuration, #24489
|
||||
set(config_log "config-${TARGET_TRIPLET}-dbg")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND "${CMAKE_COMMAND}" -DCMAKE_CONFIG_RUN=2 .
|
||||
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg"
|
||||
LOGNAME "${config_log}-2"
|
||||
)
|
||||
file(STRINGS "${CURRENT_BUILDTREES_DIR}/${config_log}-out.log" expected REGEX "wxWidgets_LIBRARIES:=")
|
||||
file(STRINGS "${CURRENT_BUILDTREES_DIR}/${config_log}-2-out.log" actual REGEX "wxWidgets_LIBRARIES:=")
|
||||
if(NOT actual STREQUAL expected)
|
||||
message(FATAL_ERROR "wxWidgets libraries changed after CMake re-run\n"
|
||||
"actual:\n${actual}\n"
|
||||
"expected:\n ${expected}\n"
|
||||
)
|
||||
endif()
|
||||
endif()
|
38
externals/vcpkg/scripts/test_ports/vcpkg-ci-wxwidgets/vcpkg.json
vendored
Executable file
38
externals/vcpkg/scripts/test_ports/vcpkg-ci-wxwidgets/vcpkg.json
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "vcpkg-ci-wxwidgets",
|
||||
"version-date": "2022-04-05",
|
||||
"description": "Builds a GUI app in order to validate the wxwidgets port.",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "wxwidgets",
|
||||
"features": [
|
||||
"example"
|
||||
]
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
"default-features"
|
||||
],
|
||||
"features": {
|
||||
"default-features": {
|
||||
"description": "Default features depending on system",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-ci-wxwidgets",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"wxrc"
|
||||
],
|
||||
"platform": "native"
|
||||
}
|
||||
]
|
||||
},
|
||||
"wxrc": {
|
||||
"description": "Test wxrc"
|
||||
}
|
||||
}
|
||||
}
|
21
externals/vcpkg/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake
vendored
Executable file
21
externals/vcpkg/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
foreach(PROG GO JOM NASM PERL YASM GIT PYTHON3 PYTHON2 RUBY 7Z NUGET FLEX BISON GPERF GASPREPROCESSOR DARK SCONS SWIG DOXYGEN ARIA2 PKGCONFIG)
|
||||
vcpkg_find_acquire_program(${PROG})
|
||||
foreach(SUBPROG IN LISTS ${PROG})
|
||||
if(NOT EXISTS "${SUBPROG}")
|
||||
message(FATAL_ERROR "Program ${SUBPROG} did not exist.")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
foreach(PROG GN NINJA MESON BAZEL)
|
||||
vcpkg_find_acquire_program(${PROG})
|
||||
foreach(SUBPROG IN LISTS ${PROG})
|
||||
if(NOT EXISTS "${SUBPROG}")
|
||||
message(FATAL_ERROR "Program ${SUBPROG} did not exist.")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
7
externals/vcpkg/scripts/test_ports/vcpkg-find-acquire-program/vcpkg.json
vendored
Executable file
7
externals/vcpkg/scripts/test_ports/vcpkg-find-acquire-program/vcpkg.json
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "vcpkg-find-acquire-program",
|
||||
"version-string": "0",
|
||||
"port-version": 1,
|
||||
"description": "Test port to exercise vcpkg_find_acquire_program",
|
||||
"supports": "windows"
|
||||
}
|
193
externals/vcpkg/scripts/test_ports/vcpkg-from-git-test/portfile.cmake
vendored
Executable file
193
externals/vcpkg/scripts/test_ports/vcpkg-from-git-test/portfile.cmake
vendored
Executable file
@@ -0,0 +1,193 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
set(git_remote "${CURRENT_BUILDTREES_DIR}/test-git-repo")
|
||||
file(REMOVE_RECURSE "${git_remote}")
|
||||
|
||||
vcpkg_find_acquire_program(GIT)
|
||||
vcpkg_list(SET git_config
|
||||
-c core.autocrlf=false
|
||||
-c user.email=vcpkg@example.com
|
||||
-c user.name=vcpkg
|
||||
)
|
||||
|
||||
vcpkg_list(SET git ${GIT} ${git_config})
|
||||
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} init "${git_remote}"
|
||||
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
|
||||
LOGNAME "git-init"
|
||||
)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} config uploadpack.allowReachableSHA1InWant true
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
LOGNAME "git-config"
|
||||
)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} checkout -b main
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
LOGNAME "git-new-branch"
|
||||
)
|
||||
|
||||
file(WRITE "${git_remote}/README.txt" "first commit")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} add "${git_remote}/README.txt"
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
LOGNAME "git-add.1"
|
||||
)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} commit -m "first commit"
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
LOGNAME "git-commit.1"
|
||||
)
|
||||
vcpkg_execute_in_download_mode(
|
||||
COMMAND ${git} rev-parse HEAD
|
||||
OUTPUT_VARIABLE ref
|
||||
RESULT_VARIABLE error_code
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
)
|
||||
if(NOT "${error_code}" EQUAL "0")
|
||||
message(FATAL_ERROR "Failed to rev-parse HEAD: ${error_code}")
|
||||
endif()
|
||||
string(STRIP "${ref}" ref)
|
||||
|
||||
file(WRITE "${git_remote}/README.txt" "second commit")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} add "${git_remote}/README.txt"
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
LOGNAME "git-add.2"
|
||||
)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} commit -m "second commit"
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
LOGNAME "git-commit.2"
|
||||
)
|
||||
vcpkg_execute_in_download_mode(
|
||||
COMMAND ${git} rev-parse HEAD
|
||||
OUTPUT_VARIABLE head_ref
|
||||
RESULT_VARIABLE error_code
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
)
|
||||
if(NOT "${error_code}" EQUAL "0")
|
||||
message(FATAL_ERROR "Failed to rev-parse HEAD: ${error_code}")
|
||||
endif()
|
||||
string(STRIP "${head_ref}" head_ref)
|
||||
|
||||
# test regular mode
|
||||
set(VCPKG_USE_HEAD_VERSION OFF)
|
||||
vcpkg_from_git(
|
||||
OUT_SOURCE_PATH source_path
|
||||
URL "${git_remote}"
|
||||
REF "${ref}"
|
||||
HEAD_REF main
|
||||
)
|
||||
file(READ "${source_path}/README.txt" contents)
|
||||
if(NOT "${contents}" STREQUAL "first commit")
|
||||
message(FATAL_ERROR "Failed to checkout the first commit. Contents were:
|
||||
${contents}
|
||||
")
|
||||
endif()
|
||||
|
||||
# test regular mode with FETCH_REF
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} config uploadpack.allowReachableSHA1InWant false
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
LOGNAME "git-config"
|
||||
)
|
||||
set(VCPKG_USE_HEAD_VERSION OFF)
|
||||
vcpkg_from_git(
|
||||
OUT_SOURCE_PATH source_path
|
||||
URL "${git_remote}"
|
||||
REF "${ref}"
|
||||
FETCH_REF main
|
||||
HEAD_REF main
|
||||
)
|
||||
file(READ "${source_path}/README.txt" contents)
|
||||
if(NOT "${contents}" STREQUAL "first commit")
|
||||
message(FATAL_ERROR "Failed to checkout the first commit. Contents were:
|
||||
${contents}
|
||||
")
|
||||
endif()
|
||||
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} config uploadpack.allowReachableSHA1InWant true
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
LOGNAME "git-config"
|
||||
)
|
||||
|
||||
# test head mode
|
||||
set(VCPKG_USE_HEAD_VERSION ON)
|
||||
vcpkg_from_git(
|
||||
OUT_SOURCE_PATH source_path
|
||||
URL "${git_remote}"
|
||||
REF "${ref}"
|
||||
HEAD_REF main
|
||||
)
|
||||
file(READ "${source_path}/README.txt" contents)
|
||||
if(NOT "${contents}" STREQUAL "second commit")
|
||||
message(FATAL_ERROR "Failed to checkout the HEAD commit. Contents were:
|
||||
${contents}
|
||||
")
|
||||
endif()
|
||||
if(NOT "${VCPKG_HEAD_VERSION}" STREQUAL "${head_ref}")
|
||||
message(FATAL_ERROR "Failed to checkout the right HEAD commit.
|
||||
Expected: ${head_ref}
|
||||
Actual : ${VCPKG_HEAD_VERSION}
|
||||
")
|
||||
endif()
|
||||
|
||||
# test head mode + no HEAD_REF -> just uses REF
|
||||
set(VCPKG_USE_HEAD_VERSION ON)
|
||||
vcpkg_from_git(
|
||||
OUT_SOURCE_PATH source_path
|
||||
URL "${git_remote}"
|
||||
REF "${ref}"
|
||||
)
|
||||
file(READ "${source_path}/README.txt" contents)
|
||||
if(NOT "${contents}" STREQUAL "first commit")
|
||||
message(FATAL_ERROR "Failed to checkout the regular commit. Contents were:
|
||||
${contents}
|
||||
")
|
||||
endif()
|
||||
|
||||
# test new head ref
|
||||
file(WRITE "${git_remote}/README.txt" "third commit")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} add "${git_remote}/README.txt"
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
LOGNAME "git.7"
|
||||
)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${git} commit -m "second commit"
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
LOGNAME "git.8"
|
||||
)
|
||||
vcpkg_execute_in_download_mode(
|
||||
COMMAND ${git} rev-parse HEAD
|
||||
OUTPUT_VARIABLE new_head_ref
|
||||
RESULT_VARIABLE error_code
|
||||
WORKING_DIRECTORY "${git_remote}"
|
||||
)
|
||||
if(NOT "${error_code}" EQUAL "0")
|
||||
message(FATAL_ERROR "Failed to rev-parse HEAD: ${error_code}")
|
||||
endif()
|
||||
string(STRIP "${new_head_ref}" new_head_ref)
|
||||
|
||||
set(VCPKG_USE_HEAD_VERSION ON)
|
||||
vcpkg_from_git(
|
||||
OUT_SOURCE_PATH source_path
|
||||
URL "${git_remote}"
|
||||
REF "${ref}"
|
||||
HEAD_REF main
|
||||
)
|
||||
file(READ "${source_path}/README.txt" contents)
|
||||
if(NOT "${contents}" STREQUAL "third commit")
|
||||
message(FATAL_ERROR "Failed to checkout the right HEAD commit. Contents were:
|
||||
${contents}
|
||||
")
|
||||
endif()
|
||||
if(NOT "${VCPKG_HEAD_VERSION}" STREQUAL "${new_head_ref}")
|
||||
message(FATAL_ERROR "Failed to checkout the right HEAD commit.
|
||||
Expected: ${new_head_ref}
|
||||
Actual : ${VCPKG_HEAD_VERSION}
|
||||
")
|
||||
endif()
|
4
externals/vcpkg/scripts/test_ports/vcpkg-from-git-test/vcpkg.json
vendored
Executable file
4
externals/vcpkg/scripts/test_ports/vcpkg-from-git-test/vcpkg.json
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "vcpkg-from-git-test",
|
||||
"version": "0"
|
||||
}
|
Reference in New Issue
Block a user