diff --git a/packager/third_party/CMakeLists.txt b/packager/third_party/CMakeLists.txt index a0a552f251..84556cc328 100644 --- a/packager/third_party/CMakeLists.txt +++ b/packager/third_party/CMakeLists.txt @@ -23,6 +23,14 @@ if(MSVC) # Use warning level 3 in third-party code, as opposed to level 4 used in our # own code. add_compile_options(/W3) + + # Do not treat warnings as errors in third-party code. + add_compile_options(/WX-) +else() + # Do not treat warnings as errors in third-party code. + # Surprisingly, both of these are required to satisfy various platforms and + # compilers at once. + add_compile_options(-Wno-error -Wno-error=all) endif() # These all use EXCLUDE_FROM_ALL so that only the referenced targets get built. diff --git a/packager/third_party/abseil-cpp/CMakeLists.txt b/packager/third_party/abseil-cpp/CMakeLists.txt index 102c2f30b4..e3bdc48859 100644 --- a/packager/third_party/abseil-cpp/CMakeLists.txt +++ b/packager/third_party/abseil-cpp/CMakeLists.txt @@ -13,22 +13,5 @@ set(ABSL_PROPAGATE_CXX_STD ON) # for one in the system. set(ABSL_USE_EXTERNAL_GOOGLETEST ON) -if(NOT MSVC) - # Silence a warning about ignored attributes. - add_compile_options(-Wno-ignored-attributes) -endif() - # With these set in scope of this folder, load the library's own CMakeLists.txt. add_subdirectory(source) - -# Clang builds of absl::time fail due to the inclusion of -Wconversion without -# -Wno-implicit-int-conversion. However, we can't add that with -# add_compile_options beforehand, because those flags go in before absl's -# -Wconversion flag gets added. We can, however, add -# -Wno-implicit-int-conversion to each necessary target after it is defined. -# This will append after absl's own flags. -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(absl_civil_time PUBLIC -Wno-implicit-int-conversion) - target_compile_options(absl_time PUBLIC -Wno-implicit-int-conversion) - target_compile_options(absl_time_zone PUBLIC -Wno-implicit-int-conversion) -endif() diff --git a/packager/third_party/curl/CMakeLists.txt b/packager/third_party/curl/CMakeLists.txt index 47a251db94..4be4452edb 100644 --- a/packager/third_party/curl/CMakeLists.txt +++ b/packager/third_party/curl/CMakeLists.txt @@ -36,10 +36,6 @@ else() set(MBEDTLS_LIBRARY mbedtls) set(MBEDX509_LIBRARY mbedx509) set(MBEDCRYPTO_LIBRARY mbedcrypto) - - # Disable a warning about sprintf on macOS. - add_compile_options(-Wno-deprecated-declarations) - add_compile_options(-Wno-unused-but-set-variable) endif() # With these set in scope of this folder, load the library's own CMakeLists.txt. diff --git a/packager/third_party/libpng/CMakeLists.txt b/packager/third_party/libpng/CMakeLists.txt index fd3247525f..097c344368 100644 --- a/packager/third_party/libpng/CMakeLists.txt +++ b/packager/third_party/libpng/CMakeLists.txt @@ -26,22 +26,6 @@ set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../zlib/source/") # Tell libpng where to find zlib library to link to. set(ZLIB_LIBRARY zlibstatic) - -# Silence these warnings: -if(MSVC) - add_compile_options( - /wd4244 - ) -else() - add_compile_options( - -Wno-maybe-uninitialized - -Wno-unused-but-set-variable - -Wno-unused-parameter - -Wno-sign-compare - -Wno-null-pointer-subtraction - ) -endif() - # With these set in scope of this folder, load the library's own CMakeLists.txt. add_subdirectory(source) diff --git a/packager/third_party/libxml2/CMakeLists.txt b/packager/third_party/libxml2/CMakeLists.txt index 2f707487d7..a551813bf7 100644 --- a/packager/third_party/libxml2/CMakeLists.txt +++ b/packager/third_party/libxml2/CMakeLists.txt @@ -48,28 +48,6 @@ set(LIBXML2_WITH_SCHEMAS ON) set(LIBXML2_WITH_THREADS ON) set(LIBXML2_WITH_TREE ON) -if(MSVC) - # Disable this warning/error about division by 0, which occurs in xpath.c: - add_compile_options(/wd4723) - # Disable this warning/error about read(), which occurs in xmlIO.c: - add_compile_options(/wd4996) - # Disable this warning/error about WIN32_LEAN_AND_MEAN: - add_compile_options(/wd4005) - # Disable integer truncation warnings in many places - add_compile_options(/wd4244 /wd4267) -else() - # Disable this warning/error, which occurs in buf.c: - add_compile_options(-Wno-format-extra-args) - # Disable this warning/error, which occurs in encoding.c: - add_compile_options(-Wno-unused-but-set-variable) - # Disable this warning/error, which occurs in xmlIO.c: - add_compile_options(-Wno-unused-parameter) - # Disable this warning/error, which occurs in xmlschemas.c: - add_compile_options(-Wno-format-truncation) - # Disable this warning/error, which occurs in tree.c: - add_compile_options(-Wno-array-bounds) -endif() - # With these set in scope of this folder, load the library's own CMakeLists.txt. add_subdirectory(source) diff --git a/packager/third_party/mbedtls/CMakeLists.txt b/packager/third_party/mbedtls/CMakeLists.txt index bd4cca1df9..b959f2e18d 100644 --- a/packager/third_party/mbedtls/CMakeLists.txt +++ b/packager/third_party/mbedtls/CMakeLists.txt @@ -14,9 +14,4 @@ set(ENABLE_TESTING OFF) set(GEN_FILES OFF) # With these set in scope of this folder, load the library's own CMakeLists.txt. - -if(NOT MSVC) - add_compile_options(-Wno-unused-but-set-variable) -endif() - add_subdirectory(source) diff --git a/packager/third_party/mongoose/CMakeLists.txt b/packager/third_party/mongoose/CMakeLists.txt index 41f5a68096..b9e951bd35 100644 --- a/packager/third_party/mongoose/CMakeLists.txt +++ b/packager/third_party/mongoose/CMakeLists.txt @@ -10,11 +10,6 @@ # Mongoose does not have its own CMakeLists.txt, but mongoose is very simple to # build. -if(MSVC) - # Disable integer truncation warnings - add_compile_options(/wd4244 /wd4267) -endif() - add_library(mongoose STATIC source/mongoose.c) target_include_directories(mongoose diff --git a/packager/third_party/protobuf/CMakeLists.txt b/packager/third_party/protobuf/CMakeLists.txt index 9d449b075b..1fd52d4b9f 100644 --- a/packager/third_party/protobuf/CMakeLists.txt +++ b/packager/third_party/protobuf/CMakeLists.txt @@ -25,48 +25,6 @@ set(ABSL_ROOT_DIR get_filename_component(ABSOLUTE_PATH ../abseil-cpp/source ABSO # Make sure protoc links against the same MSVC runtime as internal libs. set(protobuf_MSVC_STATIC_RUNTIME OFF) -# Disable these errors/warnings: -if(MSVC) - add_compile_options( - # src/google/protobuf/arena_align.h - /wd4146 # sign comparison - # src/google/protobuf/generated_message_tctable_lite.cc - /wd4141 # multiple inline keywords - # src/google/protobuf/util/message_differencer.h - /wd4100 # unreferenced formal parameter - # src/google/protobuf/text_format.cc - /wd4805 # unsafe mix of type bool and uint64_t in operation - # src/google/protobuf/compiler/cpp/field.cc via absl/log/internal/check_op.h - /wd4018 # signed/unsigned mismatch - ) -else() - add_compile_options( - # src/google/protobuf/util/message_differencer.cc - -Wno-type-limits - # src/google/protobuf/stubs/stringprintf.cc - -Wno-sign-compare - # src/google/protobuf/compiler/cpp/parse_function_generator.cc - -Wno-missing-field-initializers - # src/google/protobuf/message_lite.cc - -Wno-stringop-overflow - # src/google/protobuf/stubs/int128.cc - -Wno-shorten-64-to-32 - # src/google/protobuf/generated_message_tctable_lite.cc - -Wno-unused-function - - # There are several interfaces with ununused parameters. - -Wno-unused-parameter - # There are also redundant move calls. - -Wno-redundant-move - # There are ignored qualifiers. - -Wno-ignored-qualifiers - # There are attributes that cannot be honored. - -Wno-attributes - # There are implicit fallthroughs. - -Wno-implicit-fallthrough - ) -endif() - # Disable internal debugging features, which end up triggering further compiler # errors. add_definitions(-DNDEBUG) diff --git a/packager/third_party/zlib/CMakeLists.txt b/packager/third_party/zlib/CMakeLists.txt index 66fdc98dad..60859d6246 100644 --- a/packager/third_party/zlib/CMakeLists.txt +++ b/packager/third_party/zlib/CMakeLists.txt @@ -17,13 +17,5 @@ set(SKIP_INSTALL_ALL ON) # work, as the assembly files aren't in the repo for some reason. So don't set # the AMD64 flag. -# Silence these warnings: -if(MSVC) - add_compile_options(/wd4244) -else() - add_compile_options(-Wno-implicit-function-declaration) - add_compile_options(-Wno-deprecated-non-prototype) -endif() - # With these set in scope of this folder, load the library's own CMakeLists.txt. add_subdirectory(source)