diff options
| author | carols <[email protected]> | 2024-04-09 20:00:05 +0800 |
|---|---|---|
| committer | carols <[email protected]> | 2024-04-09 20:00:05 +0800 |
| commit | bb97da112be686014a4807ed951f7a520a9f0248 (patch) | |
| tree | 9f333f622a51a0b57c0b7246ee6e5b4473e61f95 /xmake/rules/cppfront | |
| parent | ce5259b8ef77f1bb8ad983abc2d4a4392bd6f6ea (diff) | |
cppfront: use local,and optimize some speed
Diffstat (limited to 'xmake/rules/cppfront')
| -rw-r--r-- | xmake/rules/cppfront/xmake.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/rules/cppfront/xmake.lua b/xmake/rules/cppfront/xmake.lua index 8803a7a38..7d92e0b08 100644 --- a/xmake/rules/cppfront/xmake.lua +++ b/xmake/rules/cppfront/xmake.lua @@ -77,11 +77,11 @@ rule("cppfront.build.cpp2") table.insert(target:objectfiles(), objectfile) -- add_depfiles for #include "xxxx/xxxx/xxx.h2" ,exclude // #include "xxxx.h2" - local lines = io.lines(sourcefile_cpp2) - for line in lines do - match_h2 = line:match("^ -#include *\"([%w%p]+.h2)\"") + local root_dir = path.directory(sourcefile_cpp2) + for line in io.lines(sourcefile_cpp2) do + local match_h2 = line:match("^ -#include *\"([%w%p]+.h2)\"") if match_h2 ~= nil then - batchcmds:add_depfiles(path.join(path.directory(sourcefile_cpp2), match_h2)) + batchcmds:add_depfiles(path.join(root_dir, match_h2)) end end -- add commands |
