summary refs log tree commit diff
path: root/pkgs/servers/foundationdb/patches/suppress-clang-warnings.patch
blob: 9d1ae992efc96979ee22bed9ecfc42607c96c50c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
commit 8076537a52bb026941f13f5542395aac69ef0825
Author: Austin Seipp <aseipp@pobox.com>
Date:   Sat May 4 17:34:51 2019 -0500

    cmake: add workarounds for NixOS-specific deficiencies [NixOS]
    
    The NixOS debug builder hook adds '-Wa,--compress-debug-sections' to the
    link flags (it actually adds it to the compiler flags, but the compiler
    is used for linking, so...). This makes the compiler angry when -Werror
    is passed, because it's unused at link-time (-Wa applies to the
    assembler). Suppress this warning with -Wno-unused-command-line-argument
    
    NB: we *could* use -Wno-error=unused-command-line-argument, but that
    still results in warnings anyway, just not fatal ones. We'd like to
    remove them all for the sake of the build output.
    
    Signed-off-by: Austin Seipp <aseipp@pobox.com>

diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake
index 03af9c10..7d059375 100644
--- a/cmake/ConfigureCompiler.cmake
+++ b/cmake/ConfigureCompiler.cmake
@@ -119,6 +119,11 @@ else()
   else()
     add_compile_options(-Werror)
   endif()
+  if (CLANG)
+    # aseipp: NixOS hack
+    add_compile_options(-Wno-unused-command-line-argument)
+    add_link_options(-Wno-unused-command-line-argument)
+  endif()
   add_compile_options($<$<BOOL:${GCC}>:-Wno-pragmas>)
   add_compile_options(-Wno-error=format
     -Wunused-variable