summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-03-12 00:49:30 +0800
committerruki <[email protected]>2021-03-12 00:49:30 +0800
commit70c4665832899710ca30d7147cb890198ddf8c51 (patch)
treecc81b58a2b8f5381690b5ec97dd84dd324086321
parent7669d341148455b387f4502c0c245f8c73d6b840 (diff)
rename to is_debug
-rw-r--r--xmake/core/package/package.lua13
-rw-r--r--xmake/modules/package/tools/cmake.lua6
-rw-r--r--xmake/modules/package/tools/xmake.lua2
-rw-r--r--xmake/modules/private/action/require/impl/install_packages.lua2
4 files changed, 14 insertions, 9 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 6bca52662..731058984 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -142,7 +142,7 @@ end
-- get the build mode
function _instance:mode()
- return self:debug() and "debug" or "release"
+ return self:is_debug() and "debug" or "release"
end
-- get the repository of this package
@@ -360,7 +360,7 @@ function _instance:is_verify()
end
-- is debug package?
-function _instance:debug()
+function _instance:is_debug()
return self:config("debug")
end
@@ -371,10 +371,15 @@ function _instance:is_supported()
end
-- support parallelize for installation?
-function _instance:parallelize()
+function _instance:is_parallelize()
return self:get("parallelize") ~= false
end
+-- is debug package? (deprecated)
+function _instance:debug()
+ return self:is_debug()
+end
+
-- get the filelock of the whole package directory
function _instance:filelock()
local filelock = self._FILELOCK
@@ -1672,7 +1677,7 @@ function package.load_from_system(packagename)
-- on install script
local on_install = function (pkg)
local opt = table.copy(pkg:configs())
- opt.mode = pkg:debug() and "debug" or "release"
+ opt.mode = pkg:is_debug() and "debug" or "release"
opt.plat = pkg:plat()
opt.arch = pkg:arch()
opt.require_version = pkg:version_str()
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 548b00e40..e4d77e3b2 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -474,7 +474,7 @@ function _build_for_msvc(package, configs, opt)
local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
local runenvs = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}):runenvs()
local msbuild = find_tool("msbuild", {envs = runenvs})
- os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m", "-p:Configuration=" .. (package:debug() and "Debug" or "Release"), "-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs})
+ os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m", "-p:Configuration=" .. (package:is_debug() and "Debug" or "Release"), "-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs})
end
-- do build for make
@@ -512,10 +512,10 @@ function _install_for_msvc(package, configs, opt)
local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
local runenvs = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}):runenvs()
local msbuild = find_tool("msbuild", {envs = runenvs})
- os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m", "-p:Configuration=" .. (package:debug() and "Debug" or "Release"), "-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs})
+ os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m", "-p:Configuration=" .. (package:is_debug() and "Debug" or "Release"), "-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs})
local projfile = os.isfile("INSTALL.vcxproj") and "INSTALL.vcxproj" or "INSTALL.vcproj"
if os.isfile(projfile) then
- os.vrunv(msbuild.program, {projfile, "/property:configuration=" .. (package:debug() and "Debug" or "Release")}, {envs = runenvs})
+ os.vrunv(msbuild.program, {projfile, "/property:configuration=" .. (package:is_debug() and "Debug" or "Release")}, {envs = runenvs})
os.trycp("install/bin", package:installdir())
os.trycp("install/lib", package:installdir()) -- perhaps only headers library
os.trycp("install/share", package:installdir())
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua
index e67952b52..efe5e4f09 100644
--- a/xmake/modules/package/tools/xmake.lua
+++ b/xmake/modules/package/tools/xmake.lua
@@ -45,7 +45,7 @@ function _get_configs(package, configs)
local ldflags = table.join(table.wrap(package:config("ldflags")), get_config("ldflags"))
table.insert(configs, "--plat=" .. package:plat())
table.insert(configs, "--arch=" .. package:arch())
- table.insert(configs, "--mode=" .. (package:debug() and "debug" or "release"))
+ table.insert(configs, "--mode=" .. (package:is_debug() and "debug" or "release"))
if package:is_plat("windows") then
local vs_runtime = package:config("vs_runtime")
if vs_runtime then
diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua
index b98fd6338..8358bcb3a 100644
--- a/xmake/modules/private/action/require/impl/install_packages.lua
+++ b/xmake/modules/private/action/require/impl/install_packages.lua
@@ -226,7 +226,7 @@ function _install_packages(packages_install, packages_download, installdeps)
if not group or not packages_in_group[group] then
-- disable parallelize?
- if not instance:parallelize() then
+ if not instance:is_parallelize() then
parallelize = false
end
if not parallelize then