summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Rendina <[email protected]>2025-04-08 17:12:27 +0200
committerChristian Rendina <[email protected]>2025-04-08 17:12:27 +0200
commit2051c13f735a626f7b6fd8b98aa69f01fd9cef7e (patch)
treeff2a68bb9e79e4be21ab40f36077acfa2d0971d8
parentcb97438a6ea9a5e67dca949a979d08e951b14f3d (diff)
Address reviews
-rw-r--r--tests/projects/idl/test_norpc/src/lockowner.idl24
-rw-r--r--tests/projects/idl/test_norpc_proxy/src/lockowner.idl24
-rw-r--r--tests/projects/idl/test_rpc/src/example.idl14
-rw-r--r--tests/projects/idl/test_rpc_noserver/src/example.idl14
-rw-r--r--tests/projects/idl/test_rpc_noserver/xmake.lua1
-rw-r--r--xmake/rules/platform/windows/idl/xmake.lua54
6 files changed, 65 insertions, 66 deletions
diff --git a/tests/projects/idl/test_norpc/src/lockowner.idl b/tests/projects/idl/test_norpc/src/lockowner.idl
index a63fe01bc..49d314ca2 100644
--- a/tests/projects/idl/test_norpc/src/lockowner.idl
+++ b/tests/projects/idl/test_norpc/src/lockowner.idl
@@ -8,21 +8,21 @@ import "oaidl.idl";
import "ocidl.idl";
[
- object,
- local,
- uuid(9b7e4a00-342c-4106-a19f-4f2704f689f0)
+ object,
+ local,
+ uuid(9b7e4a00-342c-4106-a19f-4f2704f689f0)
]
interface ILockOwner : IUnknown
{
- void LOEnter(
- void
- );
+ void LOEnter(
+ void
+ );
- void LOLeave(
- void
- );
+ void LOLeave(
+ void
+ );
- BOOL LOTryEnter(
- void
- );
+ BOOL LOTryEnter(
+ void
+ );
};
diff --git a/tests/projects/idl/test_norpc_proxy/src/lockowner.idl b/tests/projects/idl/test_norpc_proxy/src/lockowner.idl
index a63fe01bc..49d314ca2 100644
--- a/tests/projects/idl/test_norpc_proxy/src/lockowner.idl
+++ b/tests/projects/idl/test_norpc_proxy/src/lockowner.idl
@@ -8,21 +8,21 @@ import "oaidl.idl";
import "ocidl.idl";
[
- object,
- local,
- uuid(9b7e4a00-342c-4106-a19f-4f2704f689f0)
+ object,
+ local,
+ uuid(9b7e4a00-342c-4106-a19f-4f2704f689f0)
]
interface ILockOwner : IUnknown
{
- void LOEnter(
- void
- );
+ void LOEnter(
+ void
+ );
- void LOLeave(
- void
- );
+ void LOLeave(
+ void
+ );
- BOOL LOTryEnter(
- void
- );
+ BOOL LOTryEnter(
+ void
+ );
};
diff --git a/tests/projects/idl/test_rpc/src/example.idl b/tests/projects/idl/test_rpc/src/example.idl
index 655b7827a..1eb750a97 100644
--- a/tests/projects/idl/test_rpc/src/example.idl
+++ b/tests/projects/idl/test_rpc/src/example.idl
@@ -1,13 +1,13 @@
[
- uuid(ba209999-0c6c-11d2-97cf-00c04f8eea45),
- version(1.0)
+ uuid(ba209999-0c6c-11d2-97cf-00c04f8eea45),
+ version(1.0)
]
interface MyInterface
{
- const unsigned short INT_ARRAY_LEN = 100;
+ const unsigned short INT_ARRAY_LEN = 100;
- void MyRemoteProc(
- [in] int param1,
- [out] int outArray[INT_ARRAY_LEN]
- );
+ void MyRemoteProc(
+ [in] int param1,
+ [out] int outArray[INT_ARRAY_LEN]
+ );
}
diff --git a/tests/projects/idl/test_rpc_noserver/src/example.idl b/tests/projects/idl/test_rpc_noserver/src/example.idl
index 655b7827a..1eb750a97 100644
--- a/tests/projects/idl/test_rpc_noserver/src/example.idl
+++ b/tests/projects/idl/test_rpc_noserver/src/example.idl
@@ -1,13 +1,13 @@
[
- uuid(ba209999-0c6c-11d2-97cf-00c04f8eea45),
- version(1.0)
+ uuid(ba209999-0c6c-11d2-97cf-00c04f8eea45),
+ version(1.0)
]
interface MyInterface
{
- const unsigned short INT_ARRAY_LEN = 100;
+ const unsigned short INT_ARRAY_LEN = 100;
- void MyRemoteProc(
- [in] int param1,
- [out] int outArray[INT_ARRAY_LEN]
- );
+ void MyRemoteProc(
+ [in] int param1,
+ [out] int outArray[INT_ARRAY_LEN]
+ );
}
diff --git a/tests/projects/idl/test_rpc_noserver/xmake.lua b/tests/projects/idl/test_rpc_noserver/xmake.lua
index 6c4bcdd2b..c44a6433b 100644
--- a/tests/projects/idl/test_rpc_noserver/xmake.lua
+++ b/tests/projects/idl/test_rpc_noserver/xmake.lua
@@ -2,7 +2,6 @@ add_rules("mode.debug", "mode.release")
target("idltest_rpc_noserver")
set_kind("binary")
- --add_rules("midl")
add_files("src/*.idl", { server = false } )
add_files("src/*.c")
add_syslinks("Rpcrt4")
diff --git a/xmake/rules/platform/windows/idl/xmake.lua b/xmake/rules/platform/windows/idl/xmake.lua
index f95846c32..75c47f7e9 100644
--- a/xmake/rules/platform/windows/idl/xmake.lua
+++ b/xmake/rules/platform/windows/idl/xmake.lua
@@ -42,19 +42,19 @@ rule("platform.windows.idl")
local undefs = table.wrap(target:get("undefines") or {})
if fileconfig then
- if fileconfig.server ~= nil then
+ if fileconfig.server then
enable_server = fileconfig.server
end
- if fileconfig.client ~= nil then
+ if fileconfig.client then
enable_client = fileconfig.client
end
- if fileconfig.includedirs ~= nil then
+ if fileconfig.includedirs then
table.join2(incs, fileconfig.includedirs)
end
- if fileconfig.defines ~= nil then
+ if fileconfig.defines then
table.join2(defs, fileconfig.defines)
end
- if fileconfig.undefines ~= nil then
+ if fileconfig.undefines then
table.join2(undefs, fileconfig.undefines)
end
end
@@ -118,11 +118,8 @@ rule("platform.windows.idl")
progress.show(opt.progress, "${color.build.object}generating.idl %s", sourcefile)
os.vrunv(midl.program, flags, { envs = msvc:runenvs() })
end, { files = sourcefile, dependfile = path.join(autogendir, path.basename(sourcefile) .. ".idl.d") })
-
- --batchcmds:show_progress(opt.progress, "${color.build.object}compiling.idl %s", sourcefile)
- --batchcmds:vrunv(midl.program, flags, {envs = msvc:runenvs()})
-
end)
+
--[[
we don't have a way to detect which files midl.exe has generated and os.exists
does not work in before_buildcmd_file because in the invokation of xmake
@@ -160,37 +157,40 @@ rule("platform.windows.idl")
-- compile c files
local configs = {includedirs = autogendir, languages = "c89"}
-
+
if os.exists(icfile) then
table.insert(target:objectfiles(), icobj)
- depend.on_changed(function()
- batchcmds:show_progress(opt.progress, "${color.build.object}compiling.$(mode) %s", icfile)
- batchcmds:compile(icfile, icobj, {sourcekind = "cxx", configs = configs})
- end, { files = {icobj}, changed = target:is_rebuilt() })
+ batchcmds:show_progress(opt.progress, "${color.build.object}compiling.$(mode) %s", icfile)
+ batchcmds:compile(icfile, icobj, {sourcekind = "cxx", configs = configs})
+ batchcmds:add_depfiles(icfile)
+ batchcmds:set_depmtime(os.mtime(icobj))
+ batchcmds:set_depcache(target:dependfile(icobj))
end
if os.exists(scfile) then
table.insert(target:objectfiles(), scobj)
- depend.on_changed(function()
- batchcmds:show_progress(opt.progress, "${color.build.object}compiling.$(mode) %s", scfile)
- batchcmds:compile(scfile, scobj, {sourcekind = "cxx", configs = configs})
- end, { files = {scobj}, changed = target:is_rebuilt() })
+ batchcmds:show_progress(opt.progress, "${color.build.object}compiling.$(mode) %s", scfile)
+ batchcmds:compile(scfile, scobj, {sourcekind = "cxx", configs = configs})
+ batchcmds:add_depfiles(scfile)
+ batchcmds:set_depmtime(os.mtime(scobj))
+ batchcmds:set_depcache(target:dependfile(scobj))
end
-
if os.exists(pcfile) and enable_proxy then
table.insert(target:objectfiles(), pcobj)
- depend.on_changed(function()
- batchcmds:show_progress(opt.progress, "${color.build.object}compiling.$(mode) %s", pcfile)
- batchcmds:compile(pcfile, pcobj, {sourcekind = "cxx", configs = configs})
- end, { files = {pcobj}, changed = target:is_rebuilt() })
+ batchcmds:show_progress(opt.progress, "${color.build.object}compiling.$(mode) %s", pcfile)
+ batchcmds:compile(pcfile, pcobj, {sourcekind = "cxx", configs = configs})
+ batchcmds:add_depfiles(pcfile)
+ batchcmds:set_depmtime(os.mtime(pcobj))
+ batchcmds:set_depcache(target:dependfile(pcobj))
end
if os.exists(ccfile) then
table.insert(target:objectfiles(), ccobj)
- depend.on_changed(function()
- batchcmds:show_progress(opt.progress, "${color.build.object}compiling.$(mode) %s", ccfile)
- batchcmds:compile(ccfile, ccobj, {sourcekind = "cxx", configs = configs})
- end, { files = {ccobj}, changed = target:is_rebuilt() })
+ batchcmds:show_progress(opt.progress, "${color.build.object}compiling.$(mode) %s", ccfile)
+ batchcmds:compile(ccfile, ccobj, {sourcekind = "cxx", configs = configs})
+ batchcmds:add_depfiles(ccfile)
+ batchcmds:set_depmtime(os.mtime(ccobj))
+ batchcmds:set_depcache(target:dependfile(ccobj))
end
end)