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

Conflict between /Zi and /ZI #1051

Closed
SirLynix opened this issue Nov 17, 2020 · 3 comments
Closed

Conflict between /Zi and /ZI #1051

SirLynix opened this issue Nov 17, 2020 · 3 comments
Milestone

Comments

@SirLynix
Copy link
Member

Describe the bug

When enabling /ZI flag (for edit and continue) and enabling debug symbols, in such a way:

set_symbols("debug", "hidden")

if (is_plat("windows")) then
	add_cxxflags("/ZI")
end

both -Zi and /ZI options are passed to cl.exe, causing a D9025 warning (overriding '/Zi' with '/ZI'), this is a bit annoying.

Expected behavior

That only /ZI is passed to cl.exe.

Related Environment

  • xmake version: xmake v2.3.8+202010172345
  • os: Windows 10 2004
  • target platform: Windows
@waruqi
Copy link
Member

waruqi commented Nov 17, 2020

I will look at it.

@waruqi waruqi added this to the v2.3.9 milestone Nov 17, 2020
@waruqi
Copy link
Member

waruqi commented Nov 19, 2020

I have improve set_symbols to support /Zi, /Zi and /Z7 on dev branch. You do not need to specify additional add_cxxflags("/ZI")

set_symbols("debug") --> /Zi /Fdxxx.pdb
set_symbols("debug", "edit") --> /ZI /Fdxxx.pdb
set_symbols("debug", "embed") --> /Z7

edit and embed levels only for msvc, gcc/clang will ignore it and only use debug level.

So you only need set set_symbols("debug", "edit", "hidden")

@SirLynix
Copy link
Member Author

Thank you!

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