diff options
| author | ruki <[email protected]> | 2022-07-26 23:36:52 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-26 23:36:52 +0800 |
| commit | ce7ea0db01c9ec430c98dd37e27c956043ea2c5d (patch) | |
| tree | 06e25867800cd2adcfc329e24c763504190a6f34 /xmake/core/project | |
| parent | 9caa7031050dfa0b2122f41d54c30fd06e900872 (diff) | |
improve to install headerfiles #2577
Diffstat (limited to 'xmake/core/project')
| -rw-r--r-- | xmake/core/project/target.lua | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 81f79cbae..b00cbe15a 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -1440,7 +1440,7 @@ end -- TODO get the header files, get("headers") (deprecated) function _instance:headers(outputdir) - return self:headerfiles(outputdir, true) + return self:headerfiles(outputdir, {only_deprecated = true}) end -- get the header files @@ -1448,14 +1448,29 @@ end -- default: get("headers") + get("headerfiles") -- only_deprecated: get("headers") -- -function _instance:headerfiles(outputdir, only_deprecated) +function _instance:headerfiles(outputdir, opt) -- get header files? + opt = opt or {} local headers = self:get("headers") -- TODO deprecated + local only_deprecated = opt.only_deprecated if not only_deprecated then headers = table.join(headers or {}, self:get("headerfiles")) + -- add_headerfiles("src/*.h", {install = false}) + -- @see https://github.com/xmake-io/xmake/issues/2577 + if opt.installonly then + local installfiles = {} + for _, headerfile in ipairs(table.wrap(headers)) do + if self:extraconf("headerfiles", headerfile, "install") ~= false then + table.insert(installfiles, headerfile) + end + end + headers = installfiles + end + end + if not headers then + return end - if not headers then return end -- get the installed header directory local headerdir = outputdir |
