1 Star 0 Fork 0

kin9-0rz/xmake_pybind11_example

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
xmake.lua 640 Bytes
一键复制 编辑 原始数据 按行查看 历史
kin9-0rz 提交于 2021-12-08 18:39 +08:00 . test: 💍 一个测试例子
add_rules("mode.debug", "mode.release")
-- c++代码标准:c++11
set_languages("cxx11")
-- -O3
set_optimize("fastest")
-- -Wall
set_warnings("all")
add_cxxflags("-fPIC", "$(shell python -m pybind11 --includes)")
if is_os("macosx") then
-- macosx系统会使用clang作为编译器
add_shflags("-undefined dynamic_lookup")
end
target("pyfoo")
set_kind("shared")
add_files("src/foo.cpp")
after_build(
function(target)
local targetfile = target:targetfile()
local a, _ = os.iorun("python3-config --extension-suffix")
os.cp(targetfile, path.join("./", "pyfoo"..a:sub(1, -2)))
end
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/kin9-0rz/xmake_pybind11_example.git
git@gitee.com:kin9-0rz/xmake_pybind11_example.git
kin9-0rz
xmake_pybind11_example
xmake_pybind11_example
master

搜索帮助