diff options
| -rw-r--r-- | xmake/rules/asn1c/xmake.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xmake/rules/asn1c/xmake.lua b/xmake/rules/asn1c/xmake.lua index cc1c60dd0..d4d4dba1d 100644 --- a/xmake/rules/asn1c/xmake.lua +++ b/xmake/rules/asn1c/xmake.lua @@ -32,6 +32,12 @@ rule("asn1c") batchcmds:mkdir(sourcefile_dir) batchcmds:vrunv(asn1c.program, {path(sourcefile_asn1):absolute()}, {curdir = sourcefile_dir}) + -- add includedirs + target:add("includedirs", sourcefile_dir) + end) + on_buildcmd_file(function (target, batchcmds, sourcefile_asn1, opt) + local sourcefile_dir = path.join(target:autogendir(), "rules", "asn1c") + -- compile *.c for _, sourcefile in ipairs(os.files(path.join(sourcefile_dir, "*.c|converter-*.c"))) do local objectfile = target:objectfile(sourcefile) @@ -39,9 +45,6 @@ rule("asn1c") table.insert(target:objectfiles(), objectfile) end - -- add includedirs - target:add("includedirs", sourcefile_dir) - -- add deps batchcmds:add_depfiles(sourcefile_asn1) batchcmds:set_depcache(target:dependfile(sourcefile_asn1)) |
