Skip to content

Commit c929f09

Browse files
committed
wip
1 parent 81d5d48 commit c929f09

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Xmake/rules/cct_cpp_reflect.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ rule("cct_cpp_reflect")
1010
target:add("files", generatedCpp, {always_added = true})
1111
target:add("includedirs", target:autogendir(), {public = true})
1212
target:add("defines", path.basename(targetName):upper() .. "_BUILD", { public = false })
13+
14+
local upperPackageName = path.basename(targetName):upper()
15+
target:add("defines", upperPackageName .. "PACKAGE_BUILD", { public = false })
16+
if target:kind() == "static" then
17+
target:add("defines", upperPackageName .. "PACKAGE_STATIC", { public = true })
18+
end
1319
end)
1420

1521
before_buildcmd_files(function (target, batchcmds, sourcebatch, opt)
@@ -105,4 +111,4 @@ rule("cct_cpp_reflect")
105111
batchcmds:add_depfiles(sourcebatch.sourcefiles)
106112
batchcmds:set_depmtime(os.mtime(outputCppFile))
107113
batchcmds:set_depcache(target:dependfile(outputCppFile))
108-
end)
114+
end)

0 commit comments

Comments
 (0)