slackware-current/source/d/llvm/missing-runtime-modules/WarningFlags.cmake
Patrick J Volkerding 04d707a7ba Mon Sep 25 19:19:27 UTC 2023
ap/man-db-2.12.0-x86_64-1.txz:  Upgraded.
ap/mpg123-1.32.1-x86_64-1.txz:  Upgraded.
d/llvm-17.0.1-x86_64-1.txz:  Upgraded.
  Shared library .so-version bump.
d/lua-5.4.6-x86_64-4.txz:  Rebuilt.
  Fixed prefix and $LIBDIRSUFFIX in lua.pc. Thanks to ArTourter.
d/parallel-20230922-noarch-1.txz:  Upgraded.
kde/kdevelop-23.08.1-x86_64-2.txz:  Rebuilt.
  Recompiled against llvm-17.0.1.
l/imagemagick-7.1.1_18-x86_64-1.txz:  Upgraded.
l/libclc-17.0.1-x86_64-1.txz:  Upgraded.
l/qt5-5.15.10_20230923_6e8e373e-x86_64-1.txz:  Upgraded.
  Compiled against llvm-17.0.1.
l/spirv-llvm-translator-17.0.0-x86_64-1.txz:  Upgraded.
  Compiled against llvm-17.0.1.
x/mesa-23.2.0_rc4-x86_64-1.txz:  Upgraded.
  Compiled against llvm-17.0.1.
2023-09-25 22:29:45 +02:00

77 lines
2.6 KiB
CMake

include(HandleFlags)
# Warning flags ===============================================================
function(cxx_add_warning_flags target enable_werror enable_pedantic)
target_compile_definitions(${target} PUBLIC -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
if (MSVC)
# -W4 is the cl.exe/clang-cl equivalent of -Wall. (In cl.exe and clang-cl,
# -Wall is equivalent to -Weverything in GCC style compiler drivers.)
target_add_compile_flags_if_supported(${target} PRIVATE -W4)
else()
target_add_compile_flags_if_supported(${target} PRIVATE -Wall)
endif()
# TODO: Should -Wconversion be enabled?
target_add_compile_flags_if_supported(${target} PRIVATE
-Wextra
-Wnewline-eof
-Wshadow
-Wwrite-strings
-Wno-unused-parameter
-Wno-long-long
-Werror=return-type
-Wextra-semi
-Wundef
-Wunused-template
-Wformat-nonliteral
)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
target_add_compile_flags_if_supported(${target} PRIVATE
-Wno-user-defined-literals
-Wno-covered-switch-default
-Wno-suggest-override
)
if (LIBCXX_TARGETING_CLANG_CL)
target_add_compile_flags_if_supported(${target} PRIVATE
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-c++11-compat
-Wno-undef
-Wno-reserved-id-macro
-Wno-gnu-include-next
-Wno-gcc-compat # For ignoring "'diagnose_if' is a clang extension" warnings
-Wno-zero-as-null-pointer-constant # FIXME: Remove this and fix all occurrences.
-Wno-deprecated-dynamic-exception-spec # For auto_ptr
-Wno-sign-conversion
-Wno-old-style-cast
-Wno-deprecated # FIXME: Remove this and fix all occurrences.
-Wno-shift-sign-overflow # FIXME: Why do we need this with clang-cl but not clang?
-Wno-double-promotion # FIXME: remove me
)
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
target_add_compile_flags_if_supported(${target} PRIVATE
-Wstrict-aliasing=2
-Wstrict-overflow=4
-Wno-attributes
-Wno-literal-suffix
-Wno-c++14-compat
-Wno-noexcept-type
-Wno-suggest-override
)
endif()
if (${enable_werror})
target_add_compile_flags_if_supported(${target} PRIVATE -Werror)
target_add_compile_flags_if_supported(${target} PRIVATE -WX)
else()
# TODO(EricWF) Remove this. We shouldn't be suppressing errors when -Werror is
# added elsewhere.
target_add_compile_flags_if_supported(${target} PRIVATE -Wno-error)
endif()
if (${enable_pedantic})
target_add_compile_flags_if_supported(${target} PRIVATE -pedantic)
endif()
endfunction()