-
Notifications
You must be signed in to change notification settings - Fork 219
Fix Build Warnings on Windows #475
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,44 +146,40 @@ if (XCODE) | |
# Disable headermaps. | ||
set(CMAKE_XCODE_ATTRIBUTE_USE_HEADERMAP "NO") | ||
elseif(MSVC) | ||
# Disable unknown pragma warnings (e.g. for #pragma mark). | ||
add_compile_options(-wd4068) | ||
|
||
# TODO: these warnings come from llvmSupport. Since we don't want to diverge from llvmSupport by | ||
# addressing these warnings , disable these for now to clean the build log. | ||
# If/when we move to use LLVM's own llvmSupport, we should reenable these warnings. | ||
# Unfortunately, the headers are intermingled into the public headers | ||
# directory so we cannot mark the include search path as a SYSTEM directory | ||
# and avoid the warnings. | ||
add_compile_options( | ||
-wd4141 # 'inline' used more than once | ||
-wd4146 # Unary minus applied to unsigned type | ||
-wd4244 # Signed conversion | ||
-wd4267 # Possible loss of data conversions | ||
-wd4291 # operator new with no matching delete found | ||
-wd4800 # Forcing value to bool 'true' or 'false' | ||
-wd4996 # POSIX name for this item is deprecated | ||
) | ||
# Disable unknown pragma warnings (e.g. for #pragma mark). | ||
"-wd4068" | ||
|
||
# TODO: these warnings come from llvmSupport. Since we don't want to diverge from llvmSupport by | ||
# addressing these warnings , disable these for now to clean the build log. | ||
# If/when we move to use LLVM's own llvmSupport, we should reenable these warnings. | ||
"-wd4141" # 'inline' used more than once. | ||
"-wd4146" # Unary minus applied to unsigned type. | ||
"-wd4244" # Signed conversion. | ||
"-wd4267" # Possible loss of data conversions. | ||
"-wd4291" # Operator new with no matching delete found. | ||
"-wd4800" # Forcing value to bool 'true' or 'false'. | ||
"-wd4996" # POSIX name for this item is deprecated. | ||
"/EHsc") | ||
else () | ||
# Compile with C++14, without RTTI or exceptions. | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two flags were left out of the list below, oversight? I ask because this change adds EH functions that breaks linking the Swift package manager on Android. I can always add these flags back specifically for Android, but I wonder if you really wanted to keep them here too. |
||
# Enable additional Clang warnings. | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmost") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdocumentation -Woverloaded-virtual") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wparentheses -Wswitch") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-function -Wunused-variable") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-value -Wempty-body") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized -Wconstant-conversion") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wint-conversion -Wbool-conversion") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wenum-conversion -Wsign-compare") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnewline-eof -Wdeprecated-declarations") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Winvalid-offsetof") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wimplicit-fallthrough") | ||
add_compile_options( | ||
# Enable additional Clang warnings. | ||
"-Wmost" | ||
"-Wdocumentation" "-Woverloaded-virtual" | ||
"-Wparentheses" "-Wswitch" | ||
"-Wunused-function" "-Wunused-variable" | ||
"-Wunused-value" "-Wempty-body" | ||
"-Wuninitialized" "-Wconstant-conversion" | ||
"-Wint-conversion" "-Wbool-conversion" | ||
"-Wenum-conversion" "-Wsign-compare" | ||
"-Wnewline-eof" "-Wdeprecated-declarations" | ||
"-Winvalid-offsetof" | ||
"-Wnon-virtual-dtor" | ||
"-Wimplicit-fallthrough") | ||
endif () | ||
|
||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLLVM_ON_WIN32") | ||
add_compile_definitions("LLVM_ON_WIN32") | ||
endif() | ||
|
||
# On Linux, we may need to include a workaround for legacy libstdc++. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.