summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-05-06 23:03:56 +0800
committerruki <[email protected]>2018-05-06 23:03:56 +0800
commit6300b045a734b9d5d1f81d154365c5c4b73a650d (patch)
treef05fbb493e766e5c90ca733bdef9c7b898a40aa8
parentfe2669e329adbc7bf94ecfb6db1f08c54d506a7c (diff)
run kmdf app
-rw-r--r--tests/projects/wdk/kmdf/ioctl/xmake.lua3
-rw-r--r--xmake/rules/wdk/xmake.lua17
2 files changed, 17 insertions, 3 deletions
diff --git a/tests/projects/wdk/kmdf/ioctl/xmake.lua b/tests/projects/wdk/kmdf/ioctl/xmake.lua
index 7eedbe14c..6c7c6f7a7 100644
--- a/tests/projects/wdk/kmdf/ioctl/xmake.lua
+++ b/tests/projects/wdk/kmdf/ioctl/xmake.lua
@@ -21,9 +21,6 @@ target("nonpnp")
-- add target
target("app")
- -- add deps
- add_deps("nonpnp")
-
-- add rules
add_rules("wdk.kmdf.binary")
diff --git a/xmake/rules/wdk/xmake.lua b/xmake/rules/wdk/xmake.lua
index 7ad2b137f..002a3d08e 100644
--- a/xmake/rules/wdk/xmake.lua
+++ b/xmake/rules/wdk/xmake.lua
@@ -198,3 +198,20 @@ rule("wdk.kmdf.binary")
on_load(function (target)
import("load").kmdf_binary(target)
end)
+
+ -- after build
+ after_build(function (target)
+
+ -- imports
+ import("core.project.config")
+
+ -- get wdk
+ local wdk = target:data("wdk")
+
+ -- copy wdf redist dll libraries (WdfCoInstaller01011.dll, ..) to the target directory
+ os.cp(path.join(wdk.sdkdir, "Redist", "wdf", config.arch(), "*.dll"), target:targetdir())
+
+ -- add clean files
+ target:data_add("wdk.cleanfiles", os.files(path.join(target:targetdir(), "*.dll")))
+ end)
+