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

不能为headeronly的target正确产生vs项目 #2025

Closed
24bit-xjkp opened this issue Feb 4, 2022 · 2 comments
Closed

不能为headeronly的target正确产生vs项目 #2025

24bit-xjkp opened this issue Feb 4, 2022 · 2 comments

Comments

@24bit-xjkp
Copy link
Contributor

描述问题

我在Windows下尝试着把一个用xmake构建的headeronly项目转换成vs2022的项目,
我试着这么做:

xmake config --toolchain=clang --vs=2022 -m Debug -a x64
xmake project -k vsxmake -a "x86,x64" -m "Debug,Release,MinSizeRel,RelWithDebInfo"

config过程一切正常,xmake build也可在正常执行。但在执行xmake project时出现了错误

error: no suitable linker for headeronly.{}

显然,一个只有头文件的库不需要链接器才对。

期待的结果

vs2022是支持共享项目的。这一类headeronly的模板库应该变成C++的共享项目,以便获得正确的结果。

错误信息

xmake project -k vsxmake -m "Debug" -a "x64"
checking for Debug.x64 ...
checking for Microsoft Visual Studio (x64) version ... 2022
checking for cstddef ... ok
checking for cstddef ... ok
checking for FileOperation ... ok
checking for array ... ok
checking for string ... ok
checking for iostream ... ok
checking for ostream ... ok
checking for istream ... ok
checking for POSIX_API ... no
checking for fstream ... ok
checking for concepts ... ok
checking for concepts ... ok
checking for stdint.h ... ok
checking for c++ ... no
checking for msvcrt ... ok
checking for stdint.h ... ok
checking for MyStdHaveBasicHeaders ... ok
checking for msvcrtd ... ok
error: no suitable linker for headeronly.{}

相关环境

  • xmake版本:v2.6.3+HEAD.e2bbeb1b0
  • xmake运行平台:x64 Windows
  • xmake目标平台:x64 Windows

其他信息

我是这么配置target的

target("MyIO")
    set_kind("headeronly")
    add_headerfiles("**.hpp")
target_end()

同时在headeronly的target里并没有添加ldflags,只是有一些宏定义与扩展指令集的使用。

@24bit-xjkp 24bit-xjkp added the bug label Feb 4, 2022
@waruqi
Copy link
Member

waruqi commented Feb 8, 2022

目前还不支持 headeronly target 生成

@waruqi waruqi added this to the v2.6.4 milestone Feb 15, 2022
@waruqi
Copy link
Member

waruqi commented Feb 15, 2022

dev可以了

@waruqi waruqi closed this as completed Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants