diff options
| author | Guyutongxue <[email protected]> | 2023-11-29 11:20:38 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-29 11:20:38 +0800 |
| commit | ab9c894df1fa591a591e68e0bd5ab69b136daa78 (patch) | |
| tree | 100abb08a7baf293772466f43fc0defdf314311a | |
| parent | b1a69af220a489014cde717e192c2079414ded8e (diff) | |
Fix #4439
| -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)) |
