diff options
| author | ruki <[email protected]> | 2021-06-13 16:58:02 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-06-13 16:58:02 +0800 |
| commit | b820270442536da435f5fb5582bf56b8bde53011 (patch) | |
| tree | 5702c2b3ce13080c8618496432ea668a0294fbb7 | |
| parent | ace1280c60e84be9893b821d32fba250b0b15191 (diff) | |
fix configs
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 4f33e22e5..2c9fc0aae 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -220,19 +220,19 @@ end -- add some builtin configurations to package function _add_package_configurations(package) -- we can define configs to override it and it's default value in package() - if package:config("debug") == nil then + if package:extraconf("configs", "debug", "default") == nil then package:add("configs", "debug", {builtin = true, description = "Enable debug symbols.", default = false, type = "boolean"}) end - if package:config("shared") == nil then + if package:extraconf("configs", "shared", "default") == nil then package:add("configs", "shared", {builtin = true, description = "Build shared library.", default = false, type = "boolean"}) end - if package:config("pic") == nil then + if package:extraconf("configs", "pic", "default") == nil then package:add("configs", "pic", {builtin = true, description = "Enable the position independent code.", default = true, type = "boolean"}) end - if package:config("vs_runtime") == nil then + if package:extraconf("configs", "vs_runtime", "default") == nil then package:add("configs", "vs_runtime", {builtin = true, description = "Set vs compiler runtime.", values = {"MT", "MTd", "MD", "MDd"}}) end - if package:config("toolchains") == nil then + if package:extraconf("configs", "toolchains", "default") == nil then package:add("configs", "toolchains", {builtin = true, description = "Set package toolchains only for cross-compilation."}) end package:add("configs", "cflags", {builtin = true, description = "Set the C compiler flags."}) @@ -382,7 +382,7 @@ function _finish_requireinfo(requireinfo, package) end -- we need ensure readonly configs for _, name in ipairs(table.keys(requireinfo.configs)) do - if package:config(name) ~= nil and package:extraconf("configs", name, "readonly") then + if package:extraconf("configs", name, "readonly") then -- package:config() will use default value after loading package requireinfo.configs[name] = nil end |
