diff options
| author | ruki <[email protected]> | 2021-11-06 21:41:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-11-06 21:41:57 +0800 |
| commit | 1e4cbd0ad277904bf86366dfba44c965fc640f73 (patch) | |
| tree | 48e6812fe8a9d2c400b6be480f81f0be2640db57 /xmake/modules/lib/detect/pkgconfig.lua | |
| parent | 736dc4db6368fa4dd1770e768c5577bc8d55255d (diff) | |
add pkgconf
Diffstat (limited to 'xmake/modules/lib/detect/pkgconfig.lua')
| -rw-r--r-- | xmake/modules/lib/detect/pkgconfig.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xmake/modules/lib/detect/pkgconfig.lua b/xmake/modules/lib/detect/pkgconfig.lua index 57726bae0..cf6b6d97d 100644 --- a/xmake/modules/lib/detect/pkgconfig.lua +++ b/xmake/modules/lib/detect/pkgconfig.lua @@ -24,7 +24,15 @@ import("core.project.target") import("core.project.config") import("lib.detect.find_file") import("lib.detect.find_library") -import("detect.tools.find_pkg_config") +import("lib.detect.find_tool") + +-- get pkgconfig +function _get_pkgconfig() + local pkgconfig = find_tool("pkg-config") or find_tool("pkgconf") + if pkgconfig then + return pkgconfig.program + end +end -- get version -- @@ -34,7 +42,7 @@ import("detect.tools.find_pkg_config") function version(name, opt) -- attempt to add search paths from pkg-config - local pkgconfig = find_pkg_config() + local pkgconfig = _get_pkgconfig() if not pkgconfig then return end @@ -73,7 +81,7 @@ end function variables(name, variables, opt) -- attempt to add search paths from pkg-config - local pkgconfig = find_pkg_config() + local pkgconfig = _get_pkgconfig() if not pkgconfig then return end @@ -125,7 +133,7 @@ end function libinfo(name, opt) -- attempt to add search paths from pkg-config - local pkgconfig = find_pkg_config() + local pkgconfig = _get_pkgconfig() if not pkgconfig then return end |
