diff options
| author | ruki <[email protected]> | 2022-05-19 00:40:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-05-19 00:40:53 +0800 |
| commit | d3b2139aacaf4efba9f47e16f36d6086f9e5544b (patch) | |
| tree | 7f52fa0e4dc297cbb7cf76999bbe777a1b6a050b /xmake/modules/core/tools/cl.lua | |
| parent | 05eff25304b1a440b481fc71ec2dcb082be98e4f (diff) | |
ignore pch for preprocess
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 148957029..4966d81da 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -423,7 +423,7 @@ function _preprocess(program, argv, opt) -- get compiler flags if flag == "-showIncludes" or flag == "/showIncludes" or - flag:startswith("-I") or flag:startswith("/I") or + (flag:startswith("-I") and #flag > 2) or (flag:startswith("/I") and #flag > 2) or flag:startswith("-Yu") or flag:startswith("/Yu") or flag:startswith("-FI") or flag:startswith("/FI") or flag:startswith("-Fp") or flag:startswith("/Fp") or @@ -441,6 +441,11 @@ function _preprocess(program, argv, opt) local sourcefile = argv[#argv] assert(objectfile and sourcefile, "%s: iorunv(%s): invalid arguments!", self, program) + -- is precompiled header? + if objectfile:endswith(".pch") then + return false + end + -- do preprocess local cppfile = path.join(path.directory(objectfile), path.basename(objectfile) .. path.extension(sourcefile)) local cppfiledir = path.directory(cppfile) |
