-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
add /WX mscv compiler option for only mscv compiler #1495
Conversation
clang on windows support both gcc and mscv style options. Clang.exe on windows defaults to gcc style, which will result in /WX unknown compiler command. This will set /WX if and only if the compiler is MSVC and greater than version 1900
The msvc 2015 tests fail.. |
Ah the joys of CMake string handling. Using the list api is probably more sound regardless. |
@@ -28,13 +28,15 @@ endfunction() | |||
|
|||
# Turn on warnings on the given target | |||
function(spdlog_enable_warnings target_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check if we under msvc before creating this list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some changes. You think this is good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why all the whitespace changes all of the sudden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, sorry.
The code in the spdlog_enable_warnings function uses 4 spaces as indentation, but when I added the if statements for msvc, my vscode indented with tabs.
But it seems it did it that way to due mixed usage, didnt notice, so I just did a convert tabs to spaces inside the utils file.
I should probably revert the space/tabs thing and it should probably be done as a single pull request just changing tabs to 4 spaces or the other way around depending on your preference.
Merged. Thanks. |
clang on windows support both gcc and mscv style options. Clang.exe on windows
defaults to gcc style, which will result in /WX unknown compiler command.
This will set /WX if and only if the compiler is MSVC and greater than version 1900.
Could perhaps be done in a prettier way, but it solves the issue nicely.