Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否有意向将install后的库名以及目录名由base改为co? #64

Closed
tigerlee opened this issue May 21, 2020 · 23 comments
Closed

Comments

@tigerlee
Copy link
Contributor

目前执行xmake install后,会将头文件放在base目录下,静态库被命名为libbase.abase这个名字太普通了,不够将库与程序内部的名字区分开。既然项目名叫co,何不将头文件放在include/co目录下,且库名为libco.alibco.so

这个动静有点大,但从长远来看,我觉得有必要来执行这个改动。

@waruqi
Copy link
Collaborator

waruqi commented May 21, 2020

👍 不过这样库名跟腾讯的libco库重名了

@idealvin
Copy link
Owner

目前执行xmake install后,会将头文件放在base目录下,静态库被命名为libbase.abase这个名字太普通了,不够将库与程序内部的名字区分开。既然项目名叫co,何不将头文件放在include/co目录下,且库名为libco.alibco.so

这个动静有点大,但从长远来看,我觉得有必要来执行这个改动。

不过这样库名跟腾讯的libco库重名了

@tigerlee @waruqi
如果有更多的人赞成,那么可以改一下。重名确实是个问题,不知影响大不大?

@izhengfan
Copy link
Contributor

co base 两个名字其实都普通,也许co_base

@idealvin
Copy link
Owner

co base 两个名字其实都普通,也许co_base

名字从简,可以少敲些键盘😊

@idealvin
Copy link
Owner

@izhengfan dev分支上可否更新下cmake脚本,与xmake保持一致?

@izhengfan
Copy link
Contributor

@izhengfan dev分支上可否更新下cmake脚本,与xmake保持一致?

好的。

名字从简,可以少敲些键盘😊

那其实现在用 base 也还可以,好像没遇见过名字叫 base 的常用库。

@waruqi
Copy link
Collaborator

waruqi commented May 21, 2020

目前执行xmake install后,会将头文件放在base目录下,静态库被命名为libbase.abase这个名字太普通了,不够将库与程序内部的名字区分开。既然项目名叫co,何不将头文件放在include/co目录下,且库名为libco.alibco.so
这个动静有点大,但从长远来看,我觉得有必要来执行这个改动。

不过这样库名跟腾讯的libco库重名了

@tigerlee @waruqi
如果有更多的人赞成,那么可以改一下。重名确实是个问题,不知影响大不大?

不同领域的重名还好,关键是腾讯那个也是个协程库,相当于部分功能都是重的,对推广上也许会有些影响,毕竟更多用户只知道libco是腾讯出的那个,其他的倒是问题不大

@idealvin
Copy link
Owner

我个人觉得改下也不错,co比base更简单,顺便蹭下腾讯libco的热度😄

@tigerlee
Copy link
Contributor Author

libbase的名字不具备独特性。libco虽然有重名,但至少与项目名称是保持一致的,这也符合大多数库的命名规则(lib+name)。

idealvin pushed a commit that referenced this issue May 22, 2020
idealvin added a commit that referenced this issue May 22, 2020
rename from base to co according to #64
@idealvin
Copy link
Owner

名字已经改成 co 了,cmake 脚本估计编译不了..

@idealvin
Copy link
Owner

我考虑放弃支持cmake,不如xmake简洁明了

@waruqi
Copy link
Collaborator

waruqi commented May 22, 2020

可以用xmake来生成cmakelists, xmake project -k cmake 另外现在ninja也支持生成了。

@waruqi
Copy link
Collaborator

waruqi commented May 22, 2020

我把co库集成到xmake-repo仓库了,可以直接在xmake.lua里面使用,https://github.com/xmake-io/xmake-repo/blob/master/packages/c/co/xmake.lua

add_requires("co")
target("test")
    set_kind("binary")
    add_files("src/*.cc")
    add_packages("co")

@izhengfan
Copy link
Contributor

考虑到很多环境里有cmake但不方便装xmake,感觉比较好的办法是用xmake生成一份cmake脚本放在repo里。

@idealvin
Copy link
Owner

可以用xmake来生成cmakelists, xmake project -k cmake 另外现在ninja也支持生成了。

考虑到很多环境里有cmake但不方便装xmake,感觉比较好的办法是用xmake生成一份cmake脚本放在repo里。

生成的cmake脚本似乎是按target生成的,test目录下增加代码,可能就要重新生成一遍..

@izhengfan
Copy link
Contributor

izhengfan commented May 23, 2020

要不上 CI 吧,比如 Github Actions,可以把生成的 cmake 脚本放在 release assets 里。CI 可以向 ruqi 的 tbox 看齐😁

@idealvin
Copy link
Owner

@waruqi 请问xmake有办法生成与 co/test/xmake.lua对等的cmake脚本吗?

@idealvin
Copy link
Owner

要不上 CI 吧,比如 Github Actions,可以把生成的 cmake 脚本放在 release assets 里。CI 可以向 ruqi 的 tbox 看齐

我后面再了解下吧,这个还不熟

@izhengfan
Copy link
Contributor

我暂时写了一份可用的 cmake 脚本 a1d1732

@izhengfan
Copy link
Contributor

我自己有个分支维护一个简单的 CI ,类似这样:https://github.com/idealvin/co/compare/dev...izhengfan:dev-with-ci?expand=1#files_bucket

@idealvin
Copy link
Owner

idealvin commented May 23, 2020 via email

@idealvin
Copy link
Owner

idealvin commented May 23, 2020 via email

@waruqi
Copy link
Collaborator

waruqi commented May 23, 2020

@waruqi 请问xmake有办法生成与 co/test/xmake.lua对等的cmake脚本吗?

目前不完全等价,add_files("src/*.c")这种对应到cmake里面,我会去展开,这样通用性会好些,因为xmake的很多模式不一定能够完全对应到cmake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants