Skip to content

Commit 86970cf

Browse files
committed
Rename python.library to python.module
1 parent 5a582e2 commit 86970cf

File tree

5 files changed

+30
-5
lines changed

5 files changed

+30
-5
lines changed

tests/projects/python/pybind/example/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ add_rules("mode.release", "mode.debug")
22
add_requires("pybind11")
33

44
target("example")
5-
add_rules("python.library")
5+
add_rules("python.module")
66
add_files("src/*.cpp")
77
add_packages("pybind11")
88
set_languages("c++11")

tests/projects/python/pybind/example_with_soabi/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ add_rules("mode.release", "mode.debug")
22
add_requires("pybind11")
33

44
target("example")
5-
add_rules("python.library", {soabi = true})
5+
add_rules("python.module", {soabi = true})
66
add_files("src/*.cpp")
77
add_packages("pybind11")
88
set_languages("c++11")

xmake/rules/python/cython/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
--
2020

2121
rule("python.cython")
22-
add_deps("python.library")
22+
add_deps("python.module")
2323
set_extensions(".py", ".pyx")
2424

2525
on_load(function (target)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--!A cross-platform build utility based on Lua
2+
--
3+
-- Licensed under the Apache License, Version 2.0 (the "License");
4+
-- you may not use this file except in compliance with the License.
5+
-- You may obtain a copy of the License at
6+
--
7+
-- http://www.apache.org/licenses/LICENSE-2.0
8+
--
9+
-- Unless required by applicable law or agreed to in writing, software
10+
-- distributed under the License is distributed on an "AS IS" BASIS,
11+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
-- See the License for the specific language governing permissions and
13+
-- limitations under the License.
14+
--
15+
-- Copyright (C) 2015-present, TBOOX Open Source Group.
16+
--
17+
-- @author ruki
18+
-- @file xmake.lua
19+
--
20+
21+
rule("python.library")
22+
on_config(function (target)
23+
wprint('deprecated: please use add_rules("python.module") instead of add_rules("python.library")')
24+
end)
25+
add_deps("python.module")

xmake/rules/python/xmake.lua renamed to xmake/rules/python/module/xmake.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
--
2020

2121
-- @see https://github.com/xmake-io/xmake/issues/1896
22-
rule("python.library")
22+
rule("python.module")
2323
on_config(function (target)
2424
target:set("kind", "shared")
2525
target:set("prefixname", "")
2626
target:add("runenvs", "PYTHONPATH", target:targetdir())
27-
local soabi = target:extraconf("rules", "python.library", "soabi")
27+
local soabi = target:extraconf("rules", "python.module", "soabi")
2828
if soabi then
2929
import("lib.detect.find_tool")
3030
local python = assert(find_tool("python3"), "python not found!")

0 commit comments

Comments
 (0)