summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichardYCJ <[email protected]>2023-03-11 02:18:35 +0800
committerRichardYCJ <[email protected]>2023-03-11 02:18:35 +0800
commit000dc3a8df6d3316b16f03f32611597d9c30a2d4 (patch)
treed836e832250254ae0d82b0423b9f5bbe4331e37c
parent782550ef08e2f9dc107c46e5fda6040793d7d2ce (diff)
fix cmake::find_package envs set to nil
-rw-r--r--xmake/modules/package/manager/cmake/find_package.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/modules/package/manager/cmake/find_package.lua b/xmake/modules/package/manager/cmake/find_package.lua
index c73a2ef4c..a9f713205 100644
--- a/xmake/modules/package/manager/cmake/find_package.lua
+++ b/xmake/modules/package/manager/cmake/find_package.lua
@@ -106,12 +106,12 @@ function _find_package(cmake, name, opt)
cmakefile:close()
-- run cmake
- local envs = configs.envs or opt.envs
+ local envs = configs.envs or opt.envs or {}
-- decide whether to enable debug build type
if (not envs.CMAKE_BUILD_TYPE and configs.debug) then
envs.CMAKE_BUILD_TYPE = "Debug"
end
- try {function() return os.vrunv(cmake.program, {workdir}, {curdir = workdir, envs = envs}) end}
+ os.vrunv(cmake.program, {workdir}, {curdir = workdir, envs = envs})
-- pares defines and includedirs for macosx/linux
local links