diff options
| author | ruki <[email protected]> | 2021-10-16 23:18:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-10-16 23:18:53 +0800 |
| commit | 194e8abb709553c79d5ee34d9bd4a714aa3004d7 (patch) | |
| tree | 919729e21b2c434e63d3d8d671fdc83adebf53b5 /xmake/core/project | |
| parent | bbe1a5c2f7418d085304d1dcd0462cf4b2193497 (diff) | |
add headeronly kind for target
Diffstat (limited to 'xmake/core/project')
| -rw-r--r-- | xmake/core/project/target.lua | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 53d17dadc..d6bba579a 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -676,9 +676,19 @@ function _instance:is_static() return self:kind() == "static" end +-- is object files target? +function _instance:is_object() + return self:kind() == "object" +end + +-- is headeronly target? +function _instance:is_headeronly() + return self:kind() == "headeronly" +end + -- is library target? function _instance:is_library() - return self:is_static() or self:is_shared() + return self:is_static() or self:is_shared() or self:is_headeronly() end -- is default target? @@ -1011,13 +1021,13 @@ end -- get the target file name function _instance:filename() - -- only compile objects? no target file - local targetkind = self:kind() - if targetkind == "object" then + -- no target file? + if self:is_object() or self:is_phony() or self:is_headeronly() then return end -- make the target file name and attempt to use the format of linker first + local targetkind = self:targetkind() local filename = self:get("filename") if not filename then local prefixname = self:get("prefixname") |
