From be6390741372ee7d02f6023fa7ee2512cb9b9840 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 5 Dec 2018 00:45:35 +0800 Subject: fix pkg-config --- xmake/core/package/package.lua | 2 +- 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))) -- cgit v1.3.1