diff options
| author | ruki <[email protected]> | 2015-12-05 23:29:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-12-05 23:29:53 +0800 |
| commit | 55baf72274c1aeefceb125f49a4da77e1d49bf40 (patch) | |
| tree | 47c62985a6f4b535984d1fd58fc152610cd90364 /xmake/scripts | |
| parent | 82fc443c84a02c7cf19248c5f9a70ef9f3a2032f (diff) | |
add warning for matching files
Diffstat (limited to 'xmake/scripts')
| -rw-r--r-- | xmake/scripts/base/config.lua | 4 | ||||
| -rw-r--r-- | xmake/scripts/base/makefile.lua | 13 | ||||
| -rw-r--r-- | xmake/scripts/base/rule.lua | 3 |
3 files changed, 17 insertions, 3 deletions
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 |
