summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-21 00:35:48 +0800
committerruki <[email protected]>2022-05-21 00:35:48 +0800
commit898c534357e92437f63a4f3e12f159e07534c20c (patch)
treeb76aef9cae9b7febf378410dc9934d4e400f5c42
parent2f45397ee666ff48c7bd7046c70a66bff37d47c6 (diff)
remove more ccache
-rw-r--r--xmake/modules/core/tools/cparser.lua33
-rw-r--r--xmake/modules/core/tools/nvcc.lua3
-rw-r--r--xmake/modules/core/tools/swiftc.lua33
-rw-r--r--xmake/modules/core/tools/tcc.lua33
-rw-r--r--xmake/modules/private/cache/build_cache.lua6
5 files changed, 18 insertions, 90 deletions
diff --git a/xmake/modules/core/tools/cparser.lua b/xmake/modules/core/tools/cparser.lua
index a155b7fa2..0eb9847f0 100644
--- a/xmake/modules/core/tools/cparser.lua
+++ b/xmake/modules/core/tools/cparser.lua
@@ -23,7 +23,6 @@ import("core.base.option")
import("core.project.config")
import("core.project.project")
import("core.language.language")
-import("private.tools.ccache")
-- init it
function init(self)
@@ -145,21 +144,17 @@ end
-- link the target file
function link(self, objectfiles, targetkind, targetfile, flags)
-
- -- ensure the target directory
os.mkdir(path.directory(targetfile))
-
- -- link it
os.runv(linkargv(self, objectfiles, targetkind, targetfile, flags))
end
-- make the compile arguments list
-function _compargv1(self, sourcefile, objectfile, flags)
- return ccache.cmdargv(self:program(), table.join("-c", flags, "-o", objectfile, sourcefile))
+function compargv(self, sourcefile, objectfile, flags)
+ return self:program(), table.join("-c", flags, "-o", objectfile, sourcefile)
end
-- compile the source file
-function _compile1(self, sourcefile, objectfile, dependinfo, flags)
+function compile(self, sourcefile, objectfile, dependinfo, flags)
-- ensure the object directory
os.mkdir(path.directory(objectfile))
@@ -168,7 +163,7 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags)
try
{
function ()
- local outdata, errdata = os.iorunv(_compargv1(self, sourcefile, objectfile, flags))
+ local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, flags))
return (outdata or "") .. (errdata or "")
end,
catch
@@ -211,23 +206,3 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags)
}
end
--- make the compile arguments list
-function compargv(self, sourcefiles, objectfile, flags)
-
- -- only support single source file now
- assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-
- -- for only single source file
- return _compargv1(self, sourcefiles, objectfile, flags)
-end
-
--- compile the source file
-function compile(self, sourcefiles, objectfile, dependinfo, flags)
-
- -- only support single source file now
- assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-
- -- for only single source file
- _compile1(self, sourcefiles, objectfile, dependinfo, flags)
-end
-
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua
index 254710ab3..ac4a6efef 100644
--- a/xmake/modules/core/tools/nvcc.lua
+++ b/xmake/modules/core/tools/nvcc.lua
@@ -25,7 +25,6 @@ import("core.project.config")
import("core.project.project")
import("core.platform.platform")
import("core.language.language")
-import("private.tools.ccache")
import("utils.progress")
-- init it
@@ -328,7 +327,7 @@ end
-- make the compile arguments list
function compargv(self, sourcefile, objectfile, flags)
- return ccache.cmdargv(self:program(), table.join("-c", flags, "-o", objectfile, sourcefile))
+ return self:program(), table.join("-c", flags, "-o", objectfile, sourcefile)
end
-- compile the source file
diff --git a/xmake/modules/core/tools/swiftc.lua b/xmake/modules/core/tools/swiftc.lua
index f67a809bf..0788635bc 100644
--- a/xmake/modules/core/tools/swiftc.lua
+++ b/xmake/modules/core/tools/swiftc.lua
@@ -20,7 +20,6 @@
-- imports
import("core.project.config")
-import("private.tools.ccache")
-- init it
function init(self)
@@ -187,37 +186,13 @@ function link(self, objectfiles, targetkind, targetfile, flags)
end
-- make the compile arguments list
-function _compargv1(self, sourcefile, objectfile, flags)
- return ccache.cmdargv(self:program(), table.join("-c", flags, "-o", objectfile, sourcefile))
+function compargv(self, sourcefile, objectfile, flags)
+ return self:program(), table.join("-c", flags, "-o", objectfile, sourcefile)
end
-- compile the source file
-function _compile1(self, sourcefile, objectfile, dependinfo, flags)
-
- -- ensure the object directory
+function compile(self, sourcefile, objectfile, dependinfo, flags)
os.mkdir(path.directory(objectfile))
-
- -- compile it
- os.runv(_compargv1(self, sourcefile, objectfile, flags))
-end
-
--- make the compile arguments list
-function compargv(self, sourcefiles, objectfile, flags)
-
- -- only support single source file now
- assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-
- -- for only single source file
- return _compargv1(self, sourcefiles, objectfile, flags)
-end
-
--- compile the source file
-function compile(self, sourcefiles, objectfile, dependinfo, flags)
-
- -- only support single source file now
- assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-
- -- for only single source file
- _compile1(self, sourcefiles, objectfile, dependinfo, flags)
+ os.runv(compargv(self, sourcefile, objectfile, flags))
end
diff --git a/xmake/modules/core/tools/tcc.lua b/xmake/modules/core/tools/tcc.lua
index 7d306997f..fc4d7b5e6 100644
--- a/xmake/modules/core/tools/tcc.lua
+++ b/xmake/modules/core/tools/tcc.lua
@@ -24,7 +24,6 @@ import("core.base.global")
import("core.project.config")
import("core.project.project")
import("core.language.language")
-import("private.tools.ccache")
-- init it
function init(self)
@@ -133,21 +132,17 @@ end
-- link the target file
function link(self, objectfiles, targetkind, targetfile, flags)
-
- -- ensure the target directory
os.mkdir(path.directory(targetfile))
-
- -- link it
os.runv(linkargv(self, objectfiles, targetkind, targetfile, flags))
end
-- make the compile arguments list
-function _compargv1(self, sourcefile, objectfile, flags)
- return ccache.cmdargv(self:program(), table.join("-c", flags, "-o", objectfile, sourcefile))
+function compargv(self, sourcefile, objectfile, flags)
+ return self:program(), table.join("-c", flags, "-o", objectfile, sourcefile)
end
-- compile the source file
-function _compile1(self, sourcefile, objectfile, dependinfo, flags)
+function compile(self, sourcefile, objectfile, dependinfo, flags)
-- ensure the object directory
os.mkdir(path.directory(objectfile))
@@ -156,7 +151,7 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags)
try
{
function ()
- local outdata, errdata = os.iorunv(_compargv1(self, sourcefile, objectfile, flags))
+ local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, flags))
return (outdata or "") .. (errdata or "")
end,
catch
@@ -199,23 +194,3 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags)
}
end
--- make the compile arguments list
-function compargv(self, sourcefiles, objectfile, flags)
-
- -- only support single source file now
- assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-
- -- for only single source file
- return _compargv1(self, sourcefiles, objectfile, flags)
-end
-
--- compile the source file
-function compile(self, sourcefiles, objectfile, dependinfo, flags)
-
- -- only support single source file now
- assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-
- -- for only single source file
- _compile1(self, sourcefiles, objectfile, dependinfo, flags)
-end
-
diff --git a/xmake/modules/private/cache/build_cache.lua b/xmake/modules/private/cache/build_cache.lua
index d6b4082d5..9fd9ca460 100644
--- a/xmake/modules/private/cache/build_cache.lua
+++ b/xmake/modules/private/cache/build_cache.lua
@@ -85,12 +85,12 @@ function hitrate()
return 0
end
-
-- dump stats
function dump_stats()
local hit_count = (_g.hit_count or 0)
local total_count = (_g.total_count or 0)
local newfiles_count = (_g.newfiles_count or 0)
+ local preprocess_error_count = (_g.preprocess_error_count or 0)
vprint("")
vprint("build cache stats:")
vprint("cache directory: %s", rootdir())
@@ -98,6 +98,8 @@ function dump_stats()
vprint("cache hit: %d", hit_count)
vprint("cache miss: %d", total_count - hit_count)
vprint("new cached files: %d", newfiles_count)
+ vprint("preprocessor error: %d", preprocess_error_count)
+ vprint("")
end
-- get object file
@@ -138,6 +140,8 @@ function build(program, argv, opt)
end
end
os.rm(cppinfo.cppfile)
+ else
+ _g.preprocess_error_count = (_g.preprocess_error_count or 0) + 1
end
return cppinfo
end