summaryrefslogtreecommitdiff
path: root/xmake/modules/lib/detect/find_package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-10 23:09:04 +0800
committerruki <[email protected]>2020-11-10 23:09:04 +0800
commit8ff5cc5e71f34af2f6ed538fb33950db7e6196a5 (patch)
tree6efe56057af6f070e998fcfcc570004eed825de1 /xmake/modules/lib/detect/find_package.lua
parentc84a362b39d566dc21160b8171c5ec389dbc5e3b (diff)
switch to external include directories for package
Diffstat (limited to 'xmake/modules/lib/detect/find_package.lua')
-rw-r--r--xmake/modules/lib/detect/find_package.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/modules/lib/detect/find_package.lua b/xmake/modules/lib/detect/find_package.lua
index df54397fa..24abcb8ad 100644
--- a/xmake/modules/lib/detect/find_package.lua
+++ b/xmake/modules/lib/detect/find_package.lua
@@ -30,6 +30,7 @@ import("package.manager.find_package")
-- e.g. zlib 1.12.x (try all), xmake::zlib 1.12.x, brew::zlib, brew::pcre/libpcre16, vcpkg::zlib, conan::OpenSSL/1.0.2n@conan/stable
-- @param opt the options
-- e.g. { verbose = false, force = false, plat = "iphoneos", arch = "arm64", mode = "debug", version = "1.0.x",
+-- external = true, -- we use sysincludedirs instead of includedirs as results
-- linkdirs = {"/usr/lib"}, includedirs = "/usr/include", links = {"ssl"}, includes = {"ssl.h"}
-- packagedirs = {"/tmp/packages"}, system = true, cachekey = "xxxx"
-- pkgconfigs = {..}}
@@ -65,6 +66,9 @@ function main(name, opt)
if opt.mode then
key = key .. "_" .. opt.mode
end
+ if opt.isystem then
+ key = key .. "_isystem"
+ end
-- attempt to get result from cache first
local cacheinfo = cache.load(key)
@@ -77,6 +81,12 @@ function main(name, opt)
local found_manager_name, package_name
result, found_manager_name, package_name = find_package(name, opt)
+ -- use isystem?
+ if result and result.includedirs and opt.external then
+ result.sysincludedirs = result.includedirs
+ result.includedirs = nil
+ end
+
-- cache result
cacheinfo[name] = result and result or false
cache.save(key, cacheinfo)