build: Do not treat third-party warnings as errors (#1338)
This commit is contained in:
parent
7ef51671f1
commit
9b384828c6
|
@ -23,6 +23,14 @@ if(MSVC)
|
||||||
# Use warning level 3 in third-party code, as opposed to level 4 used in our
|
# Use warning level 3 in third-party code, as opposed to level 4 used in our
|
||||||
# own code.
|
# own code.
|
||||||
add_compile_options(/W3)
|
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()
|
endif()
|
||||||
|
|
||||||
# These all use EXCLUDE_FROM_ALL so that only the referenced targets get built.
|
# These all use EXCLUDE_FROM_ALL so that only the referenced targets get built.
|
||||||
|
|
|
@ -13,22 +13,5 @@ set(ABSL_PROPAGATE_CXX_STD ON)
|
||||||
# for one in the system.
|
# for one in the system.
|
||||||
set(ABSL_USE_EXTERNAL_GOOGLETEST ON)
|
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.
|
# With these set in scope of this folder, load the library's own CMakeLists.txt.
|
||||||
add_subdirectory(source)
|
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()
|
|
||||||
|
|
|
@ -36,10 +36,6 @@ else()
|
||||||
set(MBEDTLS_LIBRARY mbedtls)
|
set(MBEDTLS_LIBRARY mbedtls)
|
||||||
set(MBEDX509_LIBRARY mbedx509)
|
set(MBEDX509_LIBRARY mbedx509)
|
||||||
set(MBEDCRYPTO_LIBRARY mbedcrypto)
|
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()
|
endif()
|
||||||
|
|
||||||
# With these set in scope of this folder, load the library's own CMakeLists.txt.
|
# With these set in scope of this folder, load the library's own 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.
|
# Tell libpng where to find zlib library to link to.
|
||||||
set(ZLIB_LIBRARY zlibstatic)
|
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.
|
# With these set in scope of this folder, load the library's own CMakeLists.txt.
|
||||||
add_subdirectory(source)
|
add_subdirectory(source)
|
||||||
|
|
||||||
|
|
|
@ -48,28 +48,6 @@ set(LIBXML2_WITH_SCHEMAS ON)
|
||||||
set(LIBXML2_WITH_THREADS ON)
|
set(LIBXML2_WITH_THREADS ON)
|
||||||
set(LIBXML2_WITH_TREE 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.
|
# With these set in scope of this folder, load the library's own CMakeLists.txt.
|
||||||
add_subdirectory(source)
|
add_subdirectory(source)
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,4 @@ set(ENABLE_TESTING OFF)
|
||||||
set(GEN_FILES OFF)
|
set(GEN_FILES OFF)
|
||||||
|
|
||||||
# With these set in scope of this folder, load the library's own CMakeLists.txt.
|
# 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)
|
add_subdirectory(source)
|
||||||
|
|
|
@ -10,11 +10,6 @@
|
||||||
# Mongoose does not have its own CMakeLists.txt, but mongoose is very simple to
|
# Mongoose does not have its own CMakeLists.txt, but mongoose is very simple to
|
||||||
# build.
|
# build.
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
# Disable integer truncation warnings
|
|
||||||
add_compile_options(/wd4244 /wd4267)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(mongoose STATIC
|
add_library(mongoose STATIC
|
||||||
source/mongoose.c)
|
source/mongoose.c)
|
||||||
target_include_directories(mongoose
|
target_include_directories(mongoose
|
||||||
|
|
|
@ -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.
|
# Make sure protoc links against the same MSVC runtime as internal libs.
|
||||||
set(protobuf_MSVC_STATIC_RUNTIME OFF)
|
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
|
# Disable internal debugging features, which end up triggering further compiler
|
||||||
# errors.
|
# errors.
|
||||||
add_definitions(-DNDEBUG)
|
add_definitions(-DNDEBUG)
|
||||||
|
|
|
@ -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
|
# work, as the assembly files aren't in the repo for some reason. So don't set
|
||||||
# the AMD64 flag.
|
# 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.
|
# With these set in scope of this folder, load the library's own CMakeLists.txt.
|
||||||
add_subdirectory(source)
|
add_subdirectory(source)
|
||||||
|
|
Loading…
Reference in New Issue