Skip to content

Commit a553f8c

Browse files
authored
Merge pull request #6796 from Arthapz/enable-custom-wdk-path
feat(wdk rules) enable support of incomplete wdk
2 parents a8ac818 + e031b87 commit a553f8c

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

xmake/rules/wdk/inf/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ rule("wdk.inf")
4141

4242
-- get stampinf
4343
local stampinf = path.join(wdk.bindir, wdk.sdkver, arch, is_host("windows") and "stampinf.exe" or "stampinf")
44-
assert(stampinf and os.isexec(stampinf), "stampinf not found!")
4544

4645
-- save uic
4746
target:data_set("wdk.stampinf", stampinf)
@@ -93,6 +92,7 @@ rule("wdk.inf")
9392

9493
-- get stampinf
9594
local stampinf = target:data("wdk.stampinf")
95+
assert(stampinf and os.isexec(stampinf), "stampinf not found!")
9696

9797
-- update the timestamp
9898
os.cp(sourcefile, targetfile)

xmake/rules/wdk/man/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ rule("wdk.man")
4444
if not os.isexec(ctrpp) then
4545
ctrpp = path.join(wdk.bindir, wdk.sdkver, arch, "ctrpp.exe")
4646
end
47-
assert(os.isexec(ctrpp), "ctrpp not found!")
4847

4948
-- save ctrpp
5049
target:data_set("wdk.ctrpp", ctrpp)
@@ -61,6 +60,7 @@ rule("wdk.man")
6160

6261
-- get ctrpp
6362
local ctrpp = target:data("wdk.ctrpp")
63+
assert(ctrpp and os.isexec(ctrpp), "ctrpp not found!")
6464

6565
-- get output directory
6666
local outputdir = path.join(target:autogendir(), "rules", "wdk", "man")

xmake/rules/wdk/mc/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ rule("wdk.mc")
4444
if not os.isexec(mc) then
4545
mc = path.join(wdk.bindir, wdk.sdkver, arch, is_host("windows") and "mc.exe" or "mc")
4646
end
47-
assert(os.isexec(mc), "mc not found!")
4847

4948
-- save mc
5049
target:data_set("wdk.mc", mc)
@@ -61,6 +60,7 @@ rule("wdk.mc")
6160

6261
-- get mc
6362
local mc = target:data("wdk.mc")
63+
assert(mc and os.isexec(mc), "mc not found!")
6464

6565
-- get output directory
6666
local outputdir = path.join(target:autogendir(), "rules", "wdk", "mc")

xmake/rules/wdk/mof/xmake.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ rule("wdk.mof")
4747
os.run("%s %s", program, tmpmof)
4848
os.tryrm(tmpmof)
4949
end})
50-
assert(mofcomp, "mofcomp not found!")
5150

5251
-- get wmimofck
5352
local wmimofck = nil
@@ -59,7 +58,6 @@ rule("wdk.mof")
5958
else
6059
wmimofck = path.join(wdk.bindir, wdk.sdkver, "x86", "wmimofck.exe")
6160
end
62-
assert(wmimofck and os.isexec(wmimofck), "wmimofck not found!")
6361

6462
-- save mofcomp and wmimofck
6563
target:data_set("wdk.mofcomp", mofcomp)
@@ -77,9 +75,11 @@ rule("wdk.mof")
7775

7876
-- get mofcomp
7977
local mofcomp = target:data("wdk.mofcomp")
78+
assert(mofcomp and os.isexec(mofcomp), "mofcomp not found!")
8079

8180
-- get wmimofck
8281
local wmimofck = target:data("wdk.wmimofck")
82+
assert(wmimofck and os.isexec(wmimofck), "wmimofck not found!")
8383

8484
-- get output directory
8585
local outputdir = path.join(target:autogendir(), "rules", "wdk", "mof")

xmake/rules/wdk/package/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ rule("wdk.package.cab")
5555

5656
-- get makecab
5757
local makecab = find_program("makecab", {check = "/?"})
58-
assert(makecab, "makecab not found!")
58+
assert(makecab and os.isexec(makecab), "makecab not found!")
5959

6060
-- make .ddf file
6161
local file = io.open(ddfile, "w")

xmake/rules/wdk/sign/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ rule("wdk.sign")
5454
if not os.isexec(inf2cat) then
5555
inf2cat = path.join(wdk.bindir, wdk.sdkver, "x86", "inf2cat.exe")
5656
end
57-
assert(os.isexec(inf2cat), "inf2cat not found!")
5857
target:data_set("wdk.sign.inf2cat", inf2cat)
5958

6059
-- check
@@ -117,6 +116,7 @@ rule("wdk.sign")
117116

118117
-- get inf2cat
119118
local inf2cat = target:data("wdk.sign.inf2cat")
119+
assert(inf2cat and os.isexec(inf2cat), "inf2cat not found!")
120120

121121
-- sign the target file
122122
sign(target, target:targetfile(), signmode)

xmake/rules/wdk/tracewpp/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ rule("wdk.tracewpp")
4141
if not os.isexec(tracewpp) then
4242
tracewpp = path.join(wdk.bindir, wdk.sdkver, arch, is_host("windows") and "tracewpp.exe" or "tracewpp")
4343
end
44-
assert(os.isexec(tracewpp), "tracewpp not found!")
4544

4645
-- save tracewpp
4746
target:data_set("wdk.tracewpp", tracewpp)
@@ -61,6 +60,7 @@ rule("wdk.tracewpp")
6160

6261
-- get tracewpp
6362
local tracewpp = target:data("wdk.tracewpp")
63+
assert(tracewpp and os.isexec(tracewpp), "tracewpp not found!")
6464

6565
-- get outputdir
6666
local outputdir = path.join(target:autogendir(), "rules", "wdk", "wpp")

0 commit comments

Comments
 (0)