diff options
| author | ruki <[email protected]> | 2024-08-19 23:46:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-08-19 23:46:43 +0800 |
| commit | e5c5bb03024be9595b18d1e25779f40278f1d812 (patch) | |
| tree | 8b17eb0da60d65c84773c5b7680cf8bf95856356 /xmake/modules/package/tools/autoconf.lua | |
| parent | cbefe04267b1c7793d8d851dcbe25a7eb1edf73a (diff) | |
fix packagedeps
Diffstat (limited to 'xmake/modules/package/tools/autoconf.lua')
| -rw-r--r-- | xmake/modules/package/tools/autoconf.lua | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua index 0b1512d52..8600d7334 100644 --- a/xmake/modules/package/tools/autoconf.lua +++ b/xmake/modules/package/tools/autoconf.lua @@ -181,36 +181,67 @@ end -- get cflags from package deps function _get_cflags_from_packagedeps(package, opt) - local result = {} + local values for _, depname in ipairs(opt.packagedeps) do local dep = type(depname) ~= "string" and depname or package:dep(depname) if dep then local fetchinfo = dep:fetch() if fetchinfo then - table.join2(result, _map_compflags(package, "cxx", "define", fetchinfo.defines)) - table.join2(result, _translate_paths(_map_compflags(package, "cxx", "includedir", fetchinfo.includedirs))) - table.join2(result, _translate_paths(_map_compflags(package, "cxx", "sysincludedir", fetchinfo.sysincludedirs))) + if values then + values = values .. fetchinfo + else + values = fetchinfo + end end end end + -- @see https://github.com/xmake-io/xmake-repo/pull/4973#issuecomment-2295890196 + local result = {} + if values then + if values.defines then + table.join2(result, _map_compflags(package, "cxx", "define", values.defines)) + end + if values.includedirs then + table.join2(result, _translate_paths(_map_compflags(package, "cxx", "includedir", values.includedirs))) + end + if values.sysincludedirs then + table.join2(result, _translate_paths(_map_compflags(package, "cxx", "sysincludedir", values.sysincludedirs))) + end + end return result end -- get ldflags from package deps function _get_ldflags_from_packagedeps(package, opt) - local result = {} + local values for _, depname in ipairs(opt.packagedeps) do local dep = type(depname) ~= "string" and depname or package:dep(depname) if dep then local fetchinfo = dep:fetch() if fetchinfo then - table.join2(result, _translate_paths(_map_linkflags(package, "binary", {"cxx"}, "linkdir", fetchinfo.linkdirs))) - table.join2(result, _map_linkflags(package, "binary", {"cxx"}, "link", fetchinfo.links)) - table.join2(result, _translate_paths(_map_linkflags(package, "binary", {"cxx"}, "syslink", fetchinfo.syslinks))) - table.join2(result, _map_linkflags(package, "binary", {"cxx"}, "framework", fetchinfo.frameworks)) + if values then + values = values .. fetchinfo + else + values = fetchinfo + end end end end + local result = {} + if values then + if values.linkdirs then + table.join2(result, _translate_paths(_map_linkflags(package, "binary", {"cxx"}, "linkdir", values.linkdirs))) + end + if values.links then + table.join2(result, _map_linkflags(package, "binary", {"cxx"}, "link", values.links)) + end + if values.syslinks then + table.join2(result, _translate_paths(_map_linkflags(package, "binary", {"cxx"}, "syslink", values.syslinks))) + end + if values.frameworks then + table.join2(result, _map_linkflags(package, "binary", {"cxx"}, "framework", values.frameworks)) + end + end return result end |
