feat(deps): resolve pkg-config modules
VoidBuildSystem CI / sanitizers-gcc16 (push) Failing after 4s
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 5s
VoidBuildSystem CI / fuzz-clang (push) Failing after 4s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 9s
VoidBuildSystem CI / wine-windows-gcc16 (push) Failing after 49s

This commit is contained in:
faumaray committed 2026-12-05 13:55:02 +03:00
1 parent f8e0036b37
commit ce041ace07
13 files changed
+663 -12

No files matched your search

+4 -1
View File
@@ -31,7 +31,7 @@ enum class TargetKind {
};
enum class SourceKind { File, Glob, ModuleInterface, ModulePartition, HeaderUnit };
enum class LinkKind { Local, Imported };
enum class DependencySourceKind { Unspecified, Git, Package, Path, Archive, Conan };
enum class DependencySourceKind { Unspecified, Git, Package, Path, Archive, Conan, PkgConfig };
enum class CStandard { Default, C11, C17, C23 };
enum class CxxStandard { Default, Cxx17, Cxx20, Cxx23, Cxx26 };
enum class LtoMode { None, Full, Thin };
@@ -314,6 +314,9 @@ class Dependency {
Dependency &cmake(OptionMap options = {});
Dependency &meson(OptionMap options = {});
Dependency &conan(std::string reference, OptionMap options = {});
// A system library discovered through a pkg-config module spec (e.g. "zlib >= 1.2").
// Search paths come from PKG_CONFIG_PATH / PKG_CONFIG_LIBDIR plus conventional prefixes.
Dependency &pkgconfig(std::string spec);
Dependency &native_builder(OptionMap options = {});
Dependency &package(std::string id, std::string range);
Dependency &registry(std::string authority_url);
+24
View File
@@ -0,0 +1,24 @@
#pragma once
#include <Void/Build/Provider/Provider.hpp>
#include <filesystem>
#include <string>
#include <string_view>
#include <vector>
namespace Void::Build::Provider {
// Resolves a pkg-config module spec such as "zlib >= 1.2" into an imported target
// interface. `.pc` files are parsed directly (no pkg-config executable needed); search
// paths come from `search_paths` (typically PKG_CONFIG_PATH / PKG_CONFIG_LIBDIR plus
// conventional prefixes). The exported target is keyed by the module name.
[[nodiscard]] Void::Result::Result<ProviderExport, Void::Result::Error>
resolve_pkgconfig(std::string_view dependency_name, std::string_view spec,
const std::vector<std::filesystem::path> &search_paths);
// Search paths from the environment: PKG_CONFIG_PATH, or PKG_CONFIG_LIBDIR (which
// replaces the defaults) plus conventional system prefixes.
[[nodiscard]] std::vector<std::filesystem::path> pkgconfig_search_paths();
} // namespace Void::Build::Provider