diff options
| author | ruki <[email protected]> | 2018-12-05 00:45:35 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-12-04 23:29:11 +0800 |
| commit | be6390741372ee7d02f6023fa7ee2512cb9b9840 (patch) | |
| tree | 1d406acc9d0805382e0082fd42aac0e4cd045da1 | |
| parent | 6aee7d32d56860554ab336ff575e86ba98b09ef9 (diff) | |
fix pkg-config
| -rw-r--r-- | xmake/core/package/package.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/lib/detect/pkg_config.lua | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index d9f70f0d4..3c080319c 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -63,7 +63,7 @@ function _instance:_buildmode() local buildmode = self:debug() and "debug" or "release" local configs = self:configs() if configs then - self._BUILDMODE = buildmode .. "_" .. hash.uuid(table.makestr(configs, true)):split('-')[1] + self._BUILDMODE = buildmode .. "_" .. hash.uuid(table.makestr(configs, true)):split('-')[1]:lower() else self._BUILDMODE = buildmode end diff --git a/xmake/modules/lib/detect/pkg_config.lua b/xmake/modules/lib/detect/pkg_config.lua index 7766b0dcd..4c69ff93f 100644 --- a/xmake/modules/lib/detect/pkg_config.lua +++ b/xmake/modules/lib/detect/pkg_config.lua @@ -69,8 +69,8 @@ function info(name, opt) os.addenv("PKG_CONFIG_PATH", unpack(configdirs)) end - -- only find debug package? clear the other pkg-config pathes - if opt.mode == "debug" then + -- find other mode package? clear the other pkg-config pathes + if opt.mode and opt.mode ~= "release" then os.setenv("PKG_CONFIG_PATH", nil) end @@ -84,7 +84,7 @@ function info(name, opt) os.addenv("PKG_CONFIG_PATH", path.join(global.directory(), "prefix", platsubdirs, opt.mode or "release", "lib", "pkgconfig")) -- find the prefix directory of brew directly, because `brew --prefix name` is too slow! - if opt.mode ~= "debug" then + if not opt.mode or opt.mode == "release" then local pcfile = find_file(name .. ".pc", "/usr/local/Cellar/" .. (opt.brewhint or name) .. "/*/lib/pkgconfig") if pcfile then brewprefix = path.directory(path.directory(path.directory(pcfile))) |
