summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-05-22 00:41:42 +0800
committerruki <[email protected]>2018-05-21 22:10:16 +0800
commit08834be448c3a4b77202bf6420ba8adad03cb238 (patch)
tree5369ba2a92841fcb45744d38f3aa890181bfc26e
parentbea60695d89f41068f8cd4424b7a5dfacc85173c (diff)
improve find wdk
-rw-r--r--xmake/modules/detect/sdks/find_wdk.lua5
-rw-r--r--xmake/rules/wdk/man/xmake.lua5
-rw-r--r--xmake/rules/wdk/mc/xmake.lua5
-rw-r--r--xmake/rules/wdk/tracewpp/xmake.lua5
4 files changed, 17 insertions, 3 deletions
diff --git a/xmake/modules/detect/sdks/find_wdk.lua b/xmake/modules/detect/sdks/find_wdk.lua
index 327099be3..1bdda516d 100644
--- a/xmake/modules/detect/sdks/find_wdk.lua
+++ b/xmake/modules/detect/sdks/find_wdk.lua
@@ -32,6 +32,11 @@ import("core.project.config")
-- find WDK directory
function _find_sdkdir(sdkdir)
+ -- get sdk directory from the environment variables first
+ if not sdkdir then
+ sdkdir = os.getenv("WindowsSdkDir")
+ end
+
-- get sdk directory from vsvars
if not sdkdir then
local arch = config.arch()
diff --git a/xmake/rules/wdk/man/xmake.lua b/xmake/rules/wdk/man/xmake.lua
index 36dd181ba..3e40b983b 100644
--- a/xmake/rules/wdk/man/xmake.lua
+++ b/xmake/rules/wdk/man/xmake.lua
@@ -45,7 +45,10 @@ rule("wdk.man")
-- get ctrpp
local ctrpp = path.join(wdk.bindir, arch, is_host("windows") and "ctrpp.exe" or "ctrpp")
- assert(ctrpp and os.isexec(ctrpp), "ctrpp not found!")
+ if not os.isexec(ctrpp) then
+ ctrpp = path.join(wdk.bindir, wdk.sdkver, arch, is_host("windows") and "ctrpp.exe" or "ctrpp")
+ end
+ assert(os.isexec(ctrpp), "ctrpp not found!")
-- save ctrpp
target:data_set("wdk.ctrpp", ctrpp)
diff --git a/xmake/rules/wdk/mc/xmake.lua b/xmake/rules/wdk/mc/xmake.lua
index cf81e2d5b..26426481f 100644
--- a/xmake/rules/wdk/mc/xmake.lua
+++ b/xmake/rules/wdk/mc/xmake.lua
@@ -45,7 +45,10 @@ rule("wdk.mc")
-- get mc
local mc = path.join(wdk.bindir, arch, is_host("windows") and "mc.exe" or "mc")
- assert(mc and os.isexec(mc), "mc not found!")
+ if not os.isexec(mc) then
+ mc = path.join(wdk.bindir, wdk.sdkver, arch, is_host("windows") and "mc.exe" or "mc")
+ end
+ assert(os.isexec(mc), "mc not found!")
-- save mc
target:data_set("wdk.mc", mc)
diff --git a/xmake/rules/wdk/tracewpp/xmake.lua b/xmake/rules/wdk/tracewpp/xmake.lua
index 1d86d3751..46cbcfae9 100644
--- a/xmake/rules/wdk/tracewpp/xmake.lua
+++ b/xmake/rules/wdk/tracewpp/xmake.lua
@@ -42,7 +42,10 @@ rule("wdk.tracewpp")
-- get tracewpp
local tracewpp = path.join(wdk.bindir, arch, is_host("windows") and "tracewpp.exe" or "tracewpp")
- assert(tracewpp and os.isexec(tracewpp), "tracewpp not found!")
+ if not os.isexec(tracewpp) then
+ tracewpp = path.join(wdk.bindir, wdk.sdkver, arch, is_host("windows") and "tracewpp.exe" or "tracewpp")
+ end
+ assert(os.isexec(tracewpp), "tracewpp not found!")
-- save tracewpp
target:data_set("wdk.tracewpp", tracewpp)