summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-28 09:15:47 +0800
committerruki <[email protected]>2017-07-28 09:15:47 +0800
commitc109f84c28886f553c949b64944e06e97d2387b4 (patch)
tree1957ad49a6d24d6194f02e4d09758915dd4dc3a7 /xmake
parentba4a55e6c9bc347f3a15dda56cef136d350e09df (diff)
simplify build test
Diffstat (limited to 'xmake')
-rw-r--r--xmake/actions/build/kinds/object.lua6
-rw-r--r--xmake/core/project/target.lua23
2 files changed, 18 insertions, 11 deletions
diff --git a/xmake/actions/build/kinds/object.lua b/xmake/actions/build/kinds/object.lua
index e0a35e29c..045045041 100644
--- a/xmake/actions/build/kinds/object.lua
+++ b/xmake/actions/build/kinds/object.lua
@@ -99,6 +99,12 @@ function _build_object(target, buildinfo, index, sourcebatch, ccache)
depfiles = io.load(incdepfile)
end
table.insert(depfiles, sourcefile)
+
+ -- add precompiled header to the dependent files
+ local precompiled_header = target:get("precompiled_header")
+ if precompiled_header then
+ table.insert(depfiles, precompiled_header)
+ end
-- check the dependent files are modified?
local modified = false
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index beb7bfef2..add079dd7 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -26,16 +26,17 @@
local target = target or {}
-- load modules
-local os = require("base/os")
-local path = require("base/path")
-local utils = require("base/utils")
-local table = require("base/table")
-local option = require("project/option")
-local config = require("project/config")
-local linker = require("tool/linker")
-local compiler = require("tool/compiler")
-local platform = require("platform/platform")
-local language = require("language/language")
+local os = require("base/os")
+local path = require("base/path")
+local utils = require("base/utils")
+local table = require("base/table")
+local deprecated = require("base/deprecated")
+local option = require("project/option")
+local config = require("project/config")
+local linker = require("tool/linker")
+local compiler = require("tool/compiler")
+local platform = require("platform/platform")
+local language = require("language/language")
-- get the filename from the given target name and kind
function target.filename(targetname, targetkind, targetformat)
@@ -679,7 +680,7 @@ function target:configheader(outputdir)
-- mark as deprecated
if configheader then
- deprecated.add("set_config_header(\"%s\", {prefix = \"...\"})", "set_config_h(\"%s\")", configheader)
+ deprecated.add("set_config_header(\"%s\", {prefix = \"...\"})", "set_config_h(\"%s\")", path.relative(configheader, os.projectdir()))
end
end
if not configheader then