summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-04-28 17:57:29 +0800
committerruki <[email protected]>2018-04-28 17:57:29 +0800
commit4277a46cfdc23dc8d840400048eda256d8e5d1e9 (patch)
treebfe9d800a02d321e675e9e4a9cb1dcf447aa7e21
parenta896aa649265af0f7a73e7c8a1b428fb342fad87 (diff)
add some include and link dirs for umdf
-rw-r--r--xmake/modules/detect/sdks/find_wdk.lua12
-rw-r--r--xmake/rules/qt/load.lua2
-rw-r--r--xmake/rules/wdk/xmake.lua21
3 files changed, 28 insertions, 7 deletions
diff --git a/xmake/modules/detect/sdks/find_wdk.lua b/xmake/modules/detect/sdks/find_wdk.lua
index 65c775568..401346367 100644
--- a/xmake/modules/detect/sdks/find_wdk.lua
+++ b/xmake/modules/detect/sdks/find_wdk.lua
@@ -72,14 +72,14 @@ function _find_wdk(sdkdir, sdkver)
-- get the bin directory
local bindir = path.join(sdkdir, "bin")
- -- get linkdirs
- local linkdirs = {path.join(sdkdir, "Lib", sdkver)}
+ -- get the lib directory
+ local libdir = path.join(sdkdir, "Lib")
- -- get includedirs
- local includedirs = {path.join(sdkdir, "Include", sdkver)}
+ -- get the include directory
+ local includedir = path.join(sdkdir, "Include")
-- get toolchains
- return {sdkdir = sdkdir, bindir = bindir, linkdirs = linkdirs, includedirs = includedirs, sdkver = sdkver}
+ return {sdkdir = sdkdir, bindir = bindir, libdir = libdir, includedir = includedir, sdkver = sdkver}
end
-- find WDK toolchains
@@ -87,7 +87,7 @@ end
-- @param sdkdir the WDK directory
-- @param opt the argument options, .e.g {verbose = true, force = false, version = "5.9.1"}
--
--- @return the WDK toolchains. .e.g {sdkver = ..., sdkdir = ..., bindir = .., linkdirs = ..., includedirs = ..., .. }
+-- @return the WDK toolchains. .e.g {sdkver = ..., sdkdir = ..., bindir = .., libdir = ..., includedir = ..., .. }
--
-- @code
--
diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua
index 73c23d5e8..eaeb50f19 100644
--- a/xmake/rules/qt/load.lua
+++ b/xmake/rules/qt/load.lua
@@ -36,7 +36,7 @@ function main(target, opt)
-- init options
opt = opt or {}
- -- check qt sdk
+ -- get qt sdk
local qt = target:data("qt")
-- get major version
diff --git a/xmake/rules/wdk/xmake.lua b/xmake/rules/wdk/xmake.lua
index a4dacb64c..c3cf6af73 100644
--- a/xmake/rules/wdk/xmake.lua
+++ b/xmake/rules/wdk/xmake.lua
@@ -47,6 +47,27 @@ rule("wdk.driver.umdf")
-- add rules
add_deps("wdk.env")
+ -- on load
+ on_load(function (target)
+
+ -- imports
+ import("core.project.config")
+
+ -- get wdk
+ local wdk = target:data("wdk")
+
+ -- set kind: shared library
+ target:set("kind", "shared")
+
+ -- add link directories
+ target:add("linkdirs", path.join(wdk.libdir, wdk.sdkver, "um", config.arch()))
+ target:add("linkdirs", path.join(wdk.libdir, "wdf", "umdf", config.arch(), "2.0"))
+
+ -- add include directories
+ target:add("includedirs", path.join(wdk.includedir, wdk.sdkver, "um"))
+ target:add("includedirs", path.join(wdk.includedir, "wdf", "umdf", "2.0"))
+ end)
+
-- define rule: kmdf driver
rule("wdk.driver.kmdf")