Skip to content

Commit 8725288

Browse files
committed
rename package envs
1 parent a8c6000 commit 8725288

File tree

8 files changed

+12
-13
lines changed

8 files changed

+12
-13
lines changed

tests/projects/c/cosmocc/console/xmake.lua

-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ add_rules("mode.debug", "mode.release")
22

33
add_requires("cosmocc")
44

5-
-- TODO, we should add envs to toolchains/cosmocc
6-
if is_subhost("windoows") then
7-
add_requires("msys2")
8-
add_packages("msys2")
9-
end
10-
115
target("test")
126
set_kind("binary")
137
add_files("src/*.c")

xmake/core/project/package.lua

+5
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ function _instance:enable(enabled)
271271
self:set("__enabled", enabled)
272272
end
273273

274+
-- get environments
275+
function _instance:envs()
276+
return self:get("envs")
277+
end
278+
274279
-- get the given rule
275280
function _instance:rule(name)
276281
return self:rules()[name]

xmake/core/project/target.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ function _instance:pkgenvs()
13351335
end
13361336
end
13371337
for _, pkg in pkgs:orderkeys() do
1338-
local envs = pkg:get("envs")
1338+
local envs = pkg:envs()
13391339
if envs then
13401340
for name, values in table.orderpairs(envs) do
13411341
if type(values) == "table" then

xmake/toolchains/emcc/xmake.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ toolchain("emcc")
5858
toolchain:add("ldflags", "")
5959
toolchain:add("shflags", "")
6060
for _, package in ipairs(toolchain:packages()) do
61-
local envs = package:get("envs")
61+
local envs = package:envs()
6262
if envs then
6363
for _, name in ipairs({"EMSDK", "EMSDK_NODE", "EMSDK_PYTHON", "JAVA_HOME"}) do
6464
local values = envs[name]

xmake/toolchains/iverilog/xmake.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ toolchain("iverilog")
2828
import("lib.detect.find_tool")
2929
local paths = {}
3030
for _, package in ipairs(toolchain:packages()) do
31-
local envs = package:get("envs")
31+
local envs = package:envs()
3232
if envs then
3333
table.join2(paths, envs.PATH)
3434
end

xmake/toolchains/nim/xmake.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ toolchain("nim")
2626
import("lib.detect.find_tool")
2727
local paths = {}
2828
for _, package in ipairs(toolchain:packages()) do
29-
local envs = package:get("envs")
29+
local envs = package:envs()
3030
if envs then
3131
table.join2(paths, envs.PATH)
3232
end

xmake/toolchains/verilator/xmake.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ toolchain("verilator")
2626
import("lib.detect.find_tool")
2727
local paths = {}
2828
for _, package in ipairs(toolchain:packages()) do
29-
local envs = package:get("envs")
29+
local envs = package:envs()
3030
if envs then
3131
table.join2(paths, envs.PATH)
3232
end
@@ -46,7 +46,7 @@ toolchain("verilator")
4646
on_load(function (toolchain)
4747
if is_host("windows") then
4848
for _, package in ipairs(toolchain:packages()) do
49-
local envs = package:get("envs")
49+
local envs = package:envs()
5050
if envs then
5151
local verilator_root = envs.VERILATOR_ROOT
5252
if verilator_root then

xmake/toolchains/zig/xmake.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ toolchain("zig")
3030
import("lib.detect.find_tool")
3131
local paths = {}
3232
for _, package in ipairs(toolchain:packages()) do
33-
local envs = package:get("envs")
33+
local envs = package:envs()
3434
if envs then
3535
table.join2(paths, envs.PATH)
3636
end

0 commit comments

Comments
 (0)