diff options
| author | ruki <[email protected]> | 2021-01-05 00:12:21 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-01-05 00:12:21 +0800 |
| commit | 021021c87eb0709396682330e1b489eb33343f98 (patch) | |
| tree | 6524b61ac692d72a5258bbf9765a6c437c4a5148 /xmake/actions/require/impl/package.lua | |
| parent | 137d7aaad42815de20089888c4e684c25f85f1ab (diff) | |
add pic option for package
Diffstat (limited to 'xmake/actions/require/impl/package.lua')
| -rw-r--r-- | xmake/actions/require/impl/package.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua index 6ab30d8dc..1a3e77edf 100644 --- a/xmake/actions/require/impl/package.lua +++ b/xmake/actions/require/impl/package.lua @@ -236,6 +236,7 @@ function _add_package_configurations(package) package:add("configs", "cxflags", {builtin = true, description = "Set the C/C++ compiler flags."}) package:add("configs", "cxxflags", {builtin = true, description = "Set the C++ compiler flags."}) package:add("configs", "asflags", {builtin = true, description = "Set the assembler flags."}) + package:add("configs", "pic", {builtin = true, description = "Enable the position independent code.", default = true, type = "boolean"}) package:add("configs", "vs_runtime", {builtin = true, description = "Set vs compiler runtime.", default = vs_runtime, values = {"MT", "MTd", "MD", "MDd"}}) end @@ -537,7 +538,7 @@ function _load_package_depconfigs(package) local extraconfs = package:extraconf("deps") or {} -- inherit some builtin configs of root package - -- e.g. add_requires("libpng", {configs = {vs_runtime = "MD"}}) + -- e.g. add_requires("libpng", {configs = {vs_runtime = "MD", pic = false}}) -- local deps = package:get("deps") if not package:config("shared") then @@ -551,6 +552,9 @@ function _load_package_depconfigs(package) if depconf.configs.vs_runtime == nil then depconf.configs.vs_runtime = package:config("vs_runtime") end + if depconf.configs.pic == nil then + depconf.configs.pic = package:config("pic") + end end end return extraconfs |
