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

target依赖应该使用basename? #177

Closed
actboy168 opened this Issue Aug 1, 2018 · 7 comments

Comments

Projects
None yet
2 participants
@actboy168
Copy link

commented Aug 1, 2018

target("lua53-dll")
    set_kind("shared")
    set_basename("lua53")
    add_files("../third_party/lua53/*.c")
    del_files("../third_party/lua53/lua.c")
    del_files("../third_party/lua53/luac.c")
target("lua53-exe")
    set_kind("binary")
    set_basename("lua53")
    add_deps("lua53-dll")
    add_files("../third_party/lua53/lua.c")

这个是我的编译脚本,会提示说找不到lua53-dll库

@waruqi

This comment has been minimized.

Copy link
Member

commented Aug 1, 2018

跟 set_basename 没有任何关系。这个是修改target最后生成目标文件名的,如果是 link 找不到,你得看下,在编译 dll的时候,有没有导出符号,如果没导出符号,就不是生成对应的 xxx.lib ,也有link不了dll了

@actboy168

This comment has been minimized.

Copy link
Author

commented Aug 1, 2018

target("lua53")
    set_kind("shared")
    set_basename("lua53")
    add_files("../third_party/lua53/*.c")
    del_files("../third_party/lua53/lua.c")
    del_files("../third_party/lua53/luac.c")
target("lua53-exe")
    set_kind("binary")
    set_basename("lua53")
    add_deps("lua53")
    add_files("../third_party/lua53/lua.c")

这样写是可以正确编译的

@waruqi

This comment has been minimized.

Copy link
Member

commented Aug 1, 2018

这个跟刚才那个 应该没啥本质区别。。 = =

@actboy168

This comment has been minimized.

Copy link
Author

commented Aug 1, 2018

区别在于gcc的参数一个是-llua53-dll,另一个是-llua53。由于我把basename改为了lua53,所以正确的应该是-llua53。

@waruqi

This comment has been minimized.

Copy link
Member

commented Aug 1, 2018

就是说 lua53-dll那个 target,虽然改了 basename,最后link的 还是 -llua32-dll 是吧。。那应该是个bug,这个我一会看下

@waruqi

This comment has been minimized.

Copy link
Member

commented Aug 1, 2018

这个确实是个bug,我已经修复了,你可以更新下再试试,至于 #178 的问题,我后两天加个设置format的接口,不过需要等上几天。

@waruqi waruqi added this to the v2.2.2 milestone Aug 2, 2018

@waruqi waruqi added bug done labels Aug 2, 2018

@actboy168

This comment has been minimized.

Copy link
Author

commented Aug 2, 2018

可以了,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.