From 8a96a1eeafdd83afa7b1b590d06337a85eb4fba7 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 13 Jun 2021 11:10:41 +0800 Subject: fix builtin configs --- xmake/modules/private/action/require/impl/package.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index d9ee2f0cf..79ce5b7f9 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:config("debug") == 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:config("shared") == nil then package:add("configs", "shared", {builtin = true, description = "Enable shared library.", default = false, type = "boolean"}) end - if package:config("pic") ~= nil then + if package:config("pic") == 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:config("vs_runtime") == 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:config("toolchains") == 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."}) -- cgit v1.3.1