diff options
| author | ruki <[email protected]> | 2024-03-09 00:00:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-03-09 00:00:53 +0800 |
| commit | bafc5ec6449244f20be126beeca903c99f527f1a (patch) | |
| tree | 68430cddc56f70b731926a1b9a175dad6c33bcbd | |
| parent | 5c20682446eb9b990850fbc423281d394625170d (diff) | |
fix pkg-config-path
| -rw-r--r-- | xmake/core/base/path.lua | 13 | ||||
| -rw-r--r-- | xmake/modules/package/tools/autoconf.lua | 7 |
2 files changed, 10 insertions, 10 deletions
diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua index 0a9b6e2fe..7765e7cb3 100644 --- a/xmake/core/base/path.lua +++ b/xmake/core/base/path.lua @@ -346,17 +346,14 @@ end -- concat environment variable with `path.envsep()`, -- also handles more speical cases such as posix flags and windows quoted paths -function path.joinenv(env_table) - - -- check - if not env_table or #env_table == 0 then +function path.joinenv(paths, envsep) + if not paths or #paths == 0 then return "" end - - local envsep = path.envsep() + envsep = envsep or path.envsep() if xmake._HOST == "windows" then local tab = {} - for _, v in ipairs(env_table) do + for _, v in ipairs(paths) do if v ~= "" then if v:find(envsep, 1, true) then v = '"' .. v .. '"' @@ -366,7 +363,7 @@ function path.joinenv(env_table) end return table.concat(tab, envsep) else - return table.concat(env_table, envsep) + return table.concat(paths, envsep) end end diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua index fdaa3f842..bd1b71bbb 100644 --- a/xmake/modules/package/tools/autoconf.lua +++ b/xmake/modules/package/tools/autoconf.lua @@ -404,13 +404,16 @@ function buildenvs(package, opt) table.insert(ACLOCAL_PATH, aclocal) end end + envs.ACLOCAL_PATH = path.joinenv(ACLOCAL_PATH) -- fix PKG_CONFIG_PATH for windows/msys2 -- @see https://github.com/xmake-io/xmake-repo/issues/3442 if is_subhost("msys", "cygwin") then + -- pkg-config can only support for unix path and env seperator on msys/cygwin PKG_CONFIG_PATH = _translate_cygwin_paths(PKG_CONFIG_PATH) + envs.PKG_CONFIG_PATH = path.joinenv(PKG_CONFIG_PATH, ":") + else + envs.PKG_CONFIG_PATH = path.joinenv(PKG_CONFIG_PATH) end - envs.ACLOCAL_PATH = path.joinenv(ACLOCAL_PATH) - envs.PKG_CONFIG_PATH = path.joinenv(PKG_CONFIG_PATH) return envs end |
