Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2022-07-28 00:24:07 +0300
committerSiva Chandra Reddy <sivachandra@google.com>2022-08-05 02:46:38 +0300
commit2e4ef9b6efcaacd5556e8c0ddf659550d3a089a0 (patch)
tree4ea73fbd6cca89a527622c51c374c394b95f9d8c /libc/cmake/modules/LLVMLibCObjectRules.cmake
parent1bfc05270576d082a258481438993a393d171226 (diff)
[libc][NFC] Add a few compiler warning flags.
A bunch of cleanup to supress the new warnings is also done. Reviewed By: abrachet Differential Revision: https://reviews.llvm.org/D130723
Diffstat (limited to 'libc/cmake/modules/LLVMLibCObjectRules.cmake')
-rw-r--r--libc/cmake/modules/LLVMLibCObjectRules.cmake17
1 files changed, 14 insertions, 3 deletions
diff --git a/libc/cmake/modules/LLVMLibCObjectRules.cmake b/libc/cmake/modules/LLVMLibCObjectRules.cmake
index 9e825144bfda..e3919ec71f6c 100644
--- a/libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ b/libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -18,14 +18,25 @@ function(_get_common_compile_options output_var flags)
endif()
set(compile_options ${LIBC_COMPILE_OPTIONS_DEFAULT} ${ARGN})
- if(NOT ${LIBC_TARGET_OS} STREQUAL "windows")
- set(compile_options ${compile_options} -fpie -ffreestanding -fno-builtin)
- endif()
if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
+ list(APPEND compile_options "-fpie")
+ list(APPEND compile_options "-ffreestanding")
+ list(APPEND compile_options "-fno-builtin")
list(APPEND compile_options "-fno-exceptions")
list(APPEND compile_options "-fno-unwind-tables")
list(APPEND compile_options "-fno-asynchronous-unwind-tables")
list(APPEND compile_options "-fno-rtti")
+ list(APPEND compile_options "-Wall")
+ list(APPEND compile_options "-Wextra")
+ list(APPEND compile_options "-Wimplicit-fallthrough")
+ list(APPEND compile_options "-Wwrite-strings")
+ list(APPEND compile_options "-Wextra-semi")
+ list(APPEND compile_options "-Wstrict-prototypes")
+ if(NOT CMAKE_COMPILER_IS_GNUCXX)
+ list(APPEND compile_options "-Wnewline-eof")
+ list(APPEND compile_options "-Wnonportable-system-include-path")
+ list(APPEND compile_options "-Wthread-safety")
+ endif()
if(ADD_FMA_FLAG)
list(APPEND compile_options "-mfma")
endif()