From 55baf72274c1aeefceb125f49a4da77e1d49bf40 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 5 Dec 2015 23:29:53 +0800 Subject: add warning for matching files --- xmake/scripts/base/config.lua | 4 ++-- xmake/scripts/base/makefile.lua | 13 ++++++++++++- xmake/scripts/base/rule.lua | 3 +++ 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'xmake/scripts/base') diff --git a/xmake/scripts/base/config.lua b/xmake/scripts/base/config.lua index 1da6ebbca..3cea6a652 100644 --- a/xmake/scripts/base/config.lua +++ b/xmake/scripts/base/config.lua @@ -229,8 +229,8 @@ function config.load() -- make the current target configs local current = config._make(configs) - -- clear configs and mark as "rebuild" and "reconfig" if the host has been changed - if current and current.host ~= xmake._HOST then + -- clear configs and mark as "rebuild" and "reconfig" if the host has been changed + if (current and current.host ~= xmake._HOST) then -- clear configs and mark as "rebuild" config._CONFIGS = { __rebuild = true } diff --git a/xmake/scripts/base/makefile.lua b/xmake/scripts/base/makefile.lua index 522e62bad..9dbf1ae35 100644 --- a/xmake/scripts/base/makefile.lua +++ b/xmake/scripts/base/makefile.lua @@ -343,6 +343,17 @@ function makefile._make_targets(file) return true end +-- get the makefile path +function makefile.path() + + -- get the build directory + local buildir = config.get("buildir") + assert(buildir) + + -- get it + return path.translate(buildir .. "/makefile") +end + -- make makefile in the build directory function makefile.make() @@ -361,7 +372,7 @@ function makefile.make() assert(logfile) -- open the makefile - local path = buildir .. "/makefile" + local path = makefile.path() local file = io.openmk(path) if not file then -- error diff --git a/xmake/scripts/base/rule.lua b/xmake/scripts/base/rule.lua index d4f15a456..e165c6533 100644 --- a/xmake/scripts/base/rule.lua +++ b/xmake/scripts/base/rule.lua @@ -208,6 +208,9 @@ function rule.sourcefiles(target) -- match source files local files = os.match(targetfile) + if #files == 0 then + utils.warning("cannot match add_files(\"%s\")", targetfile) + end -- process source files for _, file in ipairs(files) do -- cgit v1.3.1