diff options
| author | ruki <[email protected]> | 2024-03-29 12:02:52 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-03-29 12:02:52 +0800 |
| commit | 6a6c19b86491a5830b2051d039bb5d879494c9a8 (patch) | |
| tree | f8fe7e14c7ecae0353b29626b21ef11c370781a0 | |
| parent | b5fbc28b673cd901602f54443c4679bc2a064346 (diff) | |
| parent | e93186c447c9ae9b2bd05c57a0e85b9c1beb8666 (diff) | |
Merge pull request #4897 from xmake-io/rc
improve rc deps #4893
| -rw-r--r-- | xmake/modules/core/tools/rc.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/rc.lua b/xmake/modules/core/tools/rc.lua index 55146ee76..7728e2e20 100644 --- a/xmake/modules/core/tools/rc.lua +++ b/xmake/modules/core/tools/rc.lua @@ -128,7 +128,13 @@ function compile(self, sourcefile, objectfile, dependinfo, flags) if cl then local outfile = os.tmpfile() .. ".rc.out" local errfile = os.tmpfile() .. ".rc.err" - local ok = try {function () os.execv(cl, {"-E", sourcefile}, {stdout = outfile, stderr = errfile, envs = self:runenvs()}); return true end} + local includeflags = {} + for _, flag in ipairs(flags) do + if flag:match("^[-/]I") then + table.insert(includeflags, flag) + end + end + local ok = try {function () os.execv(cl, table.join("-E", includeflags, sourcefile), {stdout = outfile, stderr = errfile, envs = self:runenvs()}); return true end} if ok and os.isfile(outfile) then local depfiles_rc local includeset = hashset.new() |
