summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/package/manager/cmake/configurations.lua1
-rw-r--r--xmake/modules/package/manager/cmake/find_package.lua7
2 files changed, 8 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/cmake/configurations.lua b/xmake/modules/package/manager/cmake/configurations.lua
index 3cc597a93..626c973d0 100644
--- a/xmake/modules/package/manager/cmake/configurations.lua
+++ b/xmake/modules/package/manager/cmake/configurations.lua
@@ -29,6 +29,7 @@ function main()
moduledirs = {description = "Set the cmake modules directories."},
presets = {description = "Set the preset values, e.g. {Boost_USE_STATIC_LIB = true}"},
envs = {description = "Set the run environments of cmake, e.g. {CMAKE_PREFIX_PATH = \"xxx\"}"},
+ debug = {description = "Set the CMAKE_BUILD_TYPE=Debug if set to ture."}
}
end
diff --git a/xmake/modules/package/manager/cmake/find_package.lua b/xmake/modules/package/manager/cmake/find_package.lua
index 9548f9d76..a25cd9e74 100644
--- a/xmake/modules/package/manager/cmake/find_package.lua
+++ b/xmake/modules/package/manager/cmake/find_package.lua
@@ -107,6 +107,13 @@ function _find_package(cmake, name, opt)
-- run cmake
local envs = configs.envs or opt.envs
+ if (configs.debug) then
+ if (not envs) then
+ envs = {CMAKE_BUILD_TYPE = "Debug"}
+ elseif (not envs.CMAKE_BUILD_TYPE) then
+ envs.CMAKE_BUILD_TYPE = "Debug"
+ end
+ end
try {function() return os.vrunv(cmake.program, {workdir}, {curdir = workdir, envs = envs}) end}
-- pares defines and includedirs for macosx/linux