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

Make binary target the startup project in vsxmake generator if possible #5401

Closed
xq114 opened this issue Jul 27, 2024 · 3 comments
Closed

Make binary target the startup project in vsxmake generator if possible #5401

xq114 opened this issue Jul 27, 2024 · 3 comments

Comments

@xq114
Copy link
Contributor

xq114 commented Jul 27, 2024

你在什么场景下需要该功能?

在vsxmake 生成vs项目时,默认的target顺序与xmake中一致,这样vs会选择第一个target作为默认startup target;然而第一个target通常并不是binary,如果第一个target是phony类型,打开直接点运行就会报错 无法启动程序 xxx 。(因为xxx并不存在)

描述可能的解决方案

https://stackoverflow.com/questions/694730/why-is-set-as-startup-option-stored-in-the-suo-file-and-not-the-sln-file

vs将startup信息存在.suo文件(二进制数据)里,不好修改,但可以调整target顺序来指定默认startup target。这样当项目中有binary类型时,将其中一个放到.sln里第一位即可指定为default startup target,直接打开点运行就可以。

描述你认为的候选方案

从xmake run的默认行为(比如跑哪些target)出发,将这些target设置为startup target,存到.suo里,但尚不清楚做法

其他信息

No response

@xq114
Copy link
Contributor Author

xq114 commented Jul 27, 2024

#2969 或者存在 BuildAll 时把BuildAll作为第一个;但 BuildAll 如果是phony target,点运行还是会报错。有没有什么办法在试图运行phony target的时候给出正确的报错信息?

@waruqi
Copy link
Member

waruqi commented Jul 27, 2024

但可以调整target顺序来指定默认startup target。这样当项目中有binary类型时,将其中一个放到.sln里第一位即可指定为default startup target,直接打开点运行就可以。

原本就有做处理,如果不 work ,可以调下这里

elseif target:is_binary() then

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


But the target order can be adjusted to specify the default startup target. In this way, when there is a binary type in the project, put one of them first in .sln and specify it as the default startup target. Just open it and run it.

It is already processed. If it does not work, you can adjust it here.

elseif target:is_binary() then

@xq114 xq114 closed this as completed Jul 30, 2024
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

3 participants