Linking libuv library in XCode

南楼画角 提交于 2019-12-31 03:01:51

问题


Has anyone had any experience with linking libuv in xcode? I've created a submodule in git to allow easy updating to the library but I can't quite figure out how to correctly add the library to the project to allow me to include uv.h. Any help would me greatly appreciated.


回答1:


You can use GYP to generate an xcodeproj for libuv (as explained in libuv's README) and add this xcodeproj to your main Xcode project.

It can be automated (for easy updating) with a simple shell script (assumes you put the libuv submodule in Externals/libuv, but can be changed):

git submodule update --init
git clone https://chromium.googlesource.com/external/gyp.git Externals/libuv/build/gyp
Externals/libuv/gyp_uv.py -f xcode

Then you'll be able to add libuv as a dependency and to the libraries to link your target to:

The last thing to do is to tell Xcode where are libuv's headers:




回答2:


You shall add header search path for libuv (/pathto/libuv/include) in Xcode's build settings.



来源:https://stackoverflow.com/questions/30650931/linking-libuv-library-in-xcode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!