summaryrefslogtreecommitdiff
path: root/xmake/scripts/base
diff options
context:
space:
mode:
authorruki <[email protected]>2015-12-27 18:18:44 +0800
committerruki <[email protected]>2015-12-27 18:18:44 +0800
commit5f680026bc7f4035c92762bd61a17c619ba652a3 (patch)
treef37ea6f70cce96418105ee2068991d624d604b89 /xmake/scripts/base
parent1456e050abbc3952984a9ae501c68faa7c790ae7 (diff)
add set_targetname api
Diffstat (limited to 'xmake/scripts/base')
-rw-r--r--xmake/scripts/base/project.lua1
-rw-r--r--xmake/scripts/base/rule.lua5
2 files changed, 6 insertions, 0 deletions
diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua
index 60dd0c379..02958c106 100644
--- a/xmake/scripts/base/project.lua
+++ b/xmake/scripts/base/project.lua
@@ -1193,6 +1193,7 @@ function project._load_targets(file)
-- register interfaces for setting values
local interfaces = { "kind"
+ , "targetname"
, "config_h_prefix"
, "version"
, "strip"
diff --git a/xmake/scripts/base/rule.lua b/xmake/scripts/base/rule.lua
index e6e724cff..7e83aee80 100644
--- a/xmake/scripts/base/rule.lua
+++ b/xmake/scripts/base/rule.lua
@@ -108,6 +108,11 @@ function rule.targetfile(target_name, target, buildir)
-- the target directory
local targetdir = target.targetdir or buildir or config.get("buildir")
assert(targetdir and type(targetdir) == "string")
+
+ -- modify target name?
+ if target.targetname then
+ target_name = target.targetname
+ end
-- the target file name
local filename = rule.filename(target_name, target.kind)