Replies: 1 comment 3 replies
-
package:add("deps", "python", {kind = "binary"}) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
在使用 boost.python 时,因为会自动加入 python 的依赖,导致 target 会链接 libpython3.x.so(实际不需要,只要链接 boost_python)。
但这样,在使用 anaconda 时,相应的 python target 在 引入时会报错:Not found libpython3.x.so.
如果在 PATH 里手工添加 conda libpython 的路径,可以导入,但会导致其他的 cpp 库出现失败,比如依赖的 PyQt 无法使用。
所以,希望在使用 boost.python 的时候,on_load 里只添加 python 的 include 路径,而不链接python.so。
我尝试以下两种方法修改 on_load 但都失败了:
package:add("deps", "python", { configs={links=""}}) 没用
package:add("includedirs", python_include_path, package:installdir("include"))
这样做,在 target 里实际添加的 includedir 前面会被加上 package 自身的安装路径,导致安装失败。(不知道算不算bug)
不知道,有什么办法可以做到只添加依赖的include,而不链接相应的库?
Beta Was this translation helpful? Give feedback.
All reactions