diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 299b8ff4d9..1d1447834c 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -2,13 +2,18 @@ ## This file defines the current expected build state of ports in CI. ## ## States -## pass - (default) the port builds in the CI system. If a port is -## missing from this file then it is assumed to build. -## fail - the port does not build in the CI system. +## (default) - +## If a port is missing from this file then it is assumed +## to build successfully if not blocked by a dependency. +## pass - The port must build successfully in the CI system. It is a hard +## error if the port build is blocked by a failed dependency. +## fail - The port build is expected to fail in the CI system. ## This is not necessarily the same as if a port is expected to build ## on a developers machine because it may fail due to the machine -## configuration. When set to fail the CI system will still attempt -## to build the port and will report a CI failure until this file is updated. +## configuration. When set to fail the CI system will silently skip +## the port for pull request CI runs. But the CI system will still +## attempt to build the port in scheduled runs, reporting unexpected +## build success as a CI failure. ## skip - Do not build this port in the CI system. ## This is added to ports that may be flaky or conflict with other ## ports. Please comment for why a port is skipped so it can be @@ -1223,6 +1228,14 @@ angle:x64-uwp=fail angle:arm64-windows=fail angle:arm-uwp=fail +cmake-user:arm-uwp=pass +cmake-user:arm64-windows=pass +cmake-user:x64-linux=pass +cmake-user:x64-osx=pass +cmake-user:x64-windows-static-md=pass +cmake-user:x64-windows-static=pass +cmake-user:x64-windows=pass +cmake-user:x86-windows=pass vcpkg-ci-boost:x64-linux=pass vcpkg-ci-boost:x64-windows-static-md=pass vcpkg-ci-boost:x64-windows-static=pass diff --git a/scripts/test_ports/cmake-user/portfile.cmake b/scripts/test_ports/cmake-user/portfile.cmake index 66ff26c2df..b3b93419fc 100644 --- a/scripts/test_ports/cmake-user/portfile.cmake +++ b/scripts/test_ports/cmake-user/portfile.cmake @@ -85,6 +85,9 @@ function(get_packages out_packages cmake_version) endforeach() endif() endif() + if("pkg-check-modules" IN_LIST FEATURES) + list(APPEND packages "ZLIBviaPkgConfig") + endif() set("${out_packages}" "${packages}" PARENT_SCOPE) endfunction() diff --git a/scripts/test_ports/cmake-user/project/CMakeLists.txt b/scripts/test_ports/cmake-user/project/CMakeLists.txt index e2a9a86f3b..5ce488701f 100644 --- a/scripts/test_ports/cmake-user/project/CMakeLists.txt +++ b/scripts/test_ports/cmake-user/project/CMakeLists.txt @@ -44,6 +44,7 @@ install(TARGETS exe lib # find_package overload and wrapper set(FIND_PACKAGES "" CACHE STRING "List of packages to be found and used") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") foreach(package ${FIND_PACKAGES}) string(TOUPPER "${package}" package_upper) set(CMAKE_FIND_DEBUG_MODE ON) diff --git a/scripts/test_ports/cmake-user/project/FindZLIBviaPkgConfig.cmake b/scripts/test_ports/cmake-user/project/FindZLIBviaPkgConfig.cmake new file mode 100644 index 0000000000..5f46a943d5 --- /dev/null +++ b/scripts/test_ports/cmake-user/project/FindZLIBviaPkgConfig.cmake @@ -0,0 +1,11 @@ +# `pkgconf` is not recognized before CMake 3.22 +find_program(PKG_CONFIG_EXECUTABLE NAMES pkgconf REQUIRED) +find_package(PkgConfig REQUIRED) +pkg_check_modules(PC_ZLIB zlib) +if(PC_ZLIB_FOUND) + if(NOT PC_ZLIB_LDFLAGS) + message(SEND_ERROR "ZLIBviaPkgConfig_LIBRARIES is empty") + endif() + set(ZLIBviaPkgConfig_LIBRARIES "${PC_ZLIB_LDFLAGS}") + set(ZLIBviaPkgConfig_FOUND "${PC_ZLIB_FOUND}") +endif() diff --git a/scripts/test_ports/cmake-user/vcpkg.json b/scripts/test_ports/cmake-user/vcpkg.json index e386f67291..70d44b9f3a 100644 --- a/scripts/test_ports/cmake-user/vcpkg.json +++ b/scripts/test_ports/cmake-user/vcpkg.json @@ -1,6 +1,6 @@ { "name": "cmake-user", - "version-date": "2022-06-11", + "version-date": "2022-07-02", "description": "Test port to verify the vcpkg toolchain in cmake user projects", "license": "MIT", "default-features": [ @@ -15,7 +15,8 @@ "default-features": false, "features": [ "cmake-current", - "find-package" + "find-package", + "pkg-check-modules" ] }, { @@ -128,6 +129,16 @@ "name": "zlib" } ] + }, + "pkg-check-modules": { + "description": "Test `find_package(PkgConfig)` and pkg_check_modules(...)", + "dependencies": [ + { + "name": "pkgconf", + "host": true + }, + "zlib" + ] } } }