From 307be8499fbc22b9d6e55eb4dbb7d459ea4128ac Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 28 Feb 2022 11:38:21 +0100 Subject: [PATCH] update maintainer docs a bit. --- docs/maintainers/maintainer-guide.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/maintainers/maintainer-guide.md b/docs/maintainers/maintainer-guide.md index 9f3dd268258436..1bf8e94836fa03 100644 --- a/docs/maintainers/maintainer-guide.md +++ b/docs/maintainers/maintainer-guide.md @@ -200,16 +200,18 @@ When defining a feature that captures an optional dependency, ensure that the dependency will not be used accidentally when the feature is not explicitly enabled. ```cmake +set(CMAKE_DISABLE_FIND_PACKAGE_ZLIB ON) +set(CMAKE_REQUIRE_FIND_PACKAGE_ZLIB OFF) if ("zlib" IN_LIST FEATURES) set(CMAKE_DISABLE_FIND_PACKAGE_ZLIB OFF) -else() - set(CMAKE_DISABLE_FIND_PACKAGE_ZLIB ON) + set(CMAKE_REQUIRE_FIND_PACKAGE_ZLIB ON) endif() vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=${CMAKE_DISABLE_FIND_PACKAGE_ZLIB} + -DCMAKE_REQUIRE_FIND_PACKAGE_ZLIB=${CMAKE_REQUIRE_FIND_PACKAGE_ZLIB} ) ``` @@ -217,6 +219,8 @@ The snippet below using `vcpkg_check_features()` is equivalent, [see the docume ```cmake vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + "zlib" CMAKE_REQUIRE_FIND_PACKAGE_ZLIB INVERTED_FEATURES "zlib" CMAKE_DISABLE_FIND_PACKAGE_ZLIB ) @@ -228,7 +232,7 @@ vcpkg_cmake_configure( ) ``` -Note that `ZLIB` in the above is case-sensitive. See the [cmake documentation](https://cmake.org/cmake/help/v3.15/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html) for more details. +Note that `ZLIB` in the above is case-sensitive. See the [CMAKE_DISABLE_FIND_PACKAGE_PackageName](https://cmake.org/cmake/help/v3.22/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html) and [CMAKE_REQUIRE_FIND_PACKAGE_PackageName](https://cmake.org/cmake/help/v3.22/variable/CMAKE_REQUIRE_FIND_PACKAGE_PackageName.html) documnetation for more details. ### Place conflicting libs in a `manual-link` directory @@ -328,6 +332,8 @@ Because of this, it is preferable to patch the buildsystem directly when setting When making changes to a library, strive to minimize the final diff. This means you should _not_ reformat the upstream source code when making changes that affect a region. Also, when disabling a conditional, it is better to add a `AND FALSE` or `&& 0` to the condition than to delete every line of the conditional. +Don't add patches if the port is outdated and updating the port to a newer released version would solve the same issue. vcpkg prefers updating ports over patching outdated versions unless the version bump breaks a considerable amount of dependent ports. + This helps to keep the size of the vcpkg repository down as well as improves the likelihood that the patch will apply to future code versions. ### Do not implement features in patches