summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-04-08 23:46:30 +0800
committerruki <[email protected]>2021-04-08 23:46:30 +0800
commitf42f0150eca0b59223eea69e0ba6f80415a3c401 (patch)
tree6d0689f2c82b545ab56dbc4b0218a7b8be5ddfb5
parentf97b9d97af8cef7446277cb1a4f0936cab4ba51b (diff)
fix installdir
-rw-r--r--CHANGELOG.md4
-rw-r--r--xmake/core/project/target.lua20
2 files changed, 8 insertions, 16 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 99bc0bf52..b4da25979 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -980,13 +980,13 @@
* [#1120](https://github.com/xmake-io/xmake/issues/1120): 添加 `core.base.cpu` 模块并且改进 `os.cpuinfo()`
* [#1325](https://github.com/xmake-io/xmake/issues/1325): 为 `add_configfiles` 添加内建的 git 变量
-## 改进
+### 改进
* [#1275](https://github.com/xmake-io/xmake/issues/1275): 改进 vsxmake 生成器,支持条件化编译 targets
* [#1290](https://github.com/xmake-io/xmake/pull/1290): 增加对 Android ndk r22 以上版本支持
* [#1311](https://github.com/xmake-io/xmake/issues/1311): 为 vsxmake 工程添加包 dll 路径,确保调试运行加载正常
-## Bugs 修复
+### Bugs 修复
* [#1266](https://github.com/xmake-io/xmake/issues/1266): 修复在 `add_repositories` 中的 repo 相对路径
* [#1288](https://github.com/xmake-io/xmake/issues/1288): 修复 vsxmake 插件处理 option 配置问题
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 6aa11d56d..7c36f1633 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1047,24 +1047,16 @@ end
function _instance:installdir()
-- get it from the cache
- local installdir = self._INSTALLDIR
+ local installdir = baseoption.get("installdir")
if not installdir then
- -- get it from target
- installdir = baseoption.get("installdir")
- if not installdir then
-
- -- DESTDIR: be compatible with https://www.gnu.org/prep/standards/html_node/DESTDIR.html
- installdir = self:get("installdir") or os.getenv("INSTALLDIR") or os.getenv("PREFIX") or os.getenv("DESTDIR") or platform.get("installdir")
- if installdir then
- installdir = installdir:trim()
- end
+ -- DESTDIR: be compatible with https://www.gnu.org/prep/standards/html_node/DESTDIR.html
+ installdir = self:get("installdir") or os.getenv("INSTALLDIR") or os.getenv("PREFIX") or os.getenv("DESTDIR") or platform.get("installdir")
+ if installdir then
+ installdir = installdir:trim()
end
- self._INSTALLDIR = installdir or false
end
-
- -- ok
- return installdir or nil
+ return installdir
end
-- get rules of the source file