Replies: 5 comments 6 replies
-
Title: Can you customize a "virtual" package? |
Beta Was this translation helpful? Give feedback.
-
用 on_fetch 做个 fetchonly package 就行了。https://github.com/xmake-io/xmake-repo/blob/bbe52197066a7a538fbac43d42139f813d9d5921/packages/o/opengl/xmake.lua#L6 另外,所有的 package 都会自动优先找系统库,走 set_base + on_fetch 重写下查找规则就行了,有没有 on_install 都无所谓。。找到了,就不会走 on_install 逻辑。。也可以 |
Beta Was this translation helpful? Give feedback.
-
牛啊,我去试试看,感谢大佬 |
Beta Was this translation helpful? Give feedback.
-
Awesome, I'll give it a try, thank you man |
Beta Was this translation helpful? Give feedback.
-
还有一个问题,就是我在 |
Beta Was this translation helpful? Give feedback.
-
Xmake Version
2.9.5
Operating System Version and Architecture
windows10
Describe Bug
xmake能否提供一个虚拟的自定义package。
举例说明一下,比如
package("pybind11")
的代码里面有add_deps(""python)
。但是此时我想用自己本地的python,而我的路径可能比较复杂,xmake并不能自动找到,那么我就想,我自己知道我的python的头文件路径和库目录,能否自己创建一个“虚拟”的package("my_python")
,该package在函数on_install
中并不会真的去安装python,而只是告诉该包的头文件目录和库目录。手动创建一个这样“虚拟”的包后,我在安装pybind11
时,只需要添加add_deps("my_python")
,那么pybind就能够找到我本地的python目录。这只是举一个例子,就是想请问下,是否支持这种只声明相关目录的“虚拟”包,类似于meson的
declare_dependency
,这样的话,包的定义方式就能够有更大的自由度了。
Expected Behavior
能够手动声明一个本地的package。
Project Configuration
无
Additional Information and Error Logs
无
Beta Was this translation helpful? Give feedback.
All reactions