diff options
| author | Zhe Chen <[email protected]> | 2018-12-19 22:28:14 +0900 |
|---|---|---|
| committer | Zhe Chen <[email protected]> | 2018-12-19 22:28:14 +0900 |
| commit | 4175116555b4337ad6cd423373462eb9107617ec (patch) | |
| tree | 5fa51c1d519075a479d261246f23599641287840 | |
| parent | 463b684ccd9a7984be37dbfc21b92451c9a0d92f (diff) | |
Simplified code.
| -rw-r--r-- | xmake/modules/lib/detect/pkg_config.lua | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/xmake/modules/lib/detect/pkg_config.lua b/xmake/modules/lib/detect/pkg_config.lua index fbd37af1a..ac16c3ec8 100644 --- a/xmake/modules/lib/detect/pkg_config.lua +++ b/xmake/modules/lib/detect/pkg_config.lua @@ -86,13 +86,9 @@ function info(name, opt) -- find the prefix directory of brew directly, because `brew --prefix name` is too slow! if not opt.mode or opt.mode == "release" then local brew_pkg_root = try { function () return os.iorunv(brew, {"--prefix"}) end } or "/usr/local" - if opt.plat == "macosx" then - brew_pkg_root = brew_pkg_root .. "/Cellar/" - elseif opt.plat == "linux" then - brew_pkg_root = brew_pkg_root .. "/opt/" - end + brew_pkg_root = path.join(brew_pkg_root, opt.plat == "macosx" and "Cellar" or "opt") - local pcfile = find_file(name .. ".pc", brew_pkg_root .. (opt.brewhint or name) .. "/*/lib/pkgconfig") + local pcfile = find_file(name .. ".pc", path.join(brew_pkg_root, (opt.brewhint or name), "*/lib/pkgconfig")) if pcfile then brewprefix = path.directory(path.directory(path.directory(pcfile))) os.addenv("PKG_CONFIG_PATH", path.directory(pcfile)) |
