diff options
| author | ruki <[email protected]> | 2023-01-14 19:11:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-01-14 19:11:59 +0800 |
| commit | a84cc5ef845c5f42675c64ed13e3148d6902b739 (patch) | |
| tree | b8a3b856bea48eca4c5c88746c11b486816020a5 | |
| parent | ee21646e7b1d123fd92eeee814ba493ee4af1d0e (diff) | |
improve to parse sourcefiles
| -rw-r--r-- | xmake/rules/verilator/xmake.lua | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/xmake/rules/verilator/xmake.lua b/xmake/rules/verilator/xmake.lua index eef59d458..f5904bd32 100644 --- a/xmake/rules/verilator/xmake.lua +++ b/xmake/rules/verilator/xmake.lua @@ -152,6 +152,10 @@ endmodule]]) -- parse some configurations from cmakefile local global_classes = {} + local classefiles_slow = {} + local classefiles_fast = {} + local supportfiles_slow = {} + local supportfiles_fast = {} io.gsub(cmakefile, "set%((%S-) (.-)%)", function (key, values) if key == targetname .. "_GLOBAL" then -- get global class source files @@ -162,12 +166,27 @@ endmodule]]) table.insert(global_classes, classfile) end end + elseif key == targetname .. "_CLASSES_SLOW" then + for classfile in values:gmatch("\"(.-)\"") do + table.insert(classefiles_slow, classfile) + end + elseif key == targetname .. "_CLASSES_FAST" then + for classfile in values:gmatch("\"(.-)\"") do + table.insert(classefiles_fast, classfile) + end + elseif key == targetname .. "_SUPPORT_SLOW" then + for classfile in values:gmatch("\"(.-)\"") do + table.insert(supportfiles_slow, classfile) + end + elseif key == targetname .. "_SUPPORT_FAST" then + for classfile in values:gmatch("\"(.-)\"") do + table.insert(supportfiles_fast, classfile) + end end end) -- get compiled source files - local sourcefiles = os.files(path.join(autogendir, "*.cpp")) - table.join2(sourcefiles, global_classes) + local sourcefiles = table.join(global_classes, classefiles_slow, classefiles_fast, supportfiles_slow, supportfiles_fast) -- do build for _, sourcefile in ipairs(sourcefiles) do |
