Serenity Operating System
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Meta: Move compiler flags into standalone CMake files

This way we can have all of them in a single place, similar to how we
structure options added via the serenity_option() macro.

+76 -75
+1 -59
CMakeLists.txt
··· 129 129 130 130 endif() 131 131 132 - set(CMAKE_CXX_STANDARD 20) 133 - set(CMAKE_CXX_STANDARD_REQUIRED ON) 134 - set(CMAKE_CXX_EXTENSIONS OFF) 135 - 136 132 if (ENABLE_ALL_DEBUG_FACILITIES) 137 133 set(ENABLE_ALL_THE_DEBUG_MACROS ON) 138 134 set(ENABLE_EXTRA_KERNEL_DEBUG_SYMBOLS ON) ··· 165 161 # This will need to be revisited when the Loader supports RPATH/RUN_PATH. 166 162 set(CMAKE_SKIP_RPATH TRUE) 167 163 168 - add_compile_options(-Wall) 169 - add_compile_options(-Wextra) 170 - 171 - if (NOT CMAKE_HOST_SYSTEM_NAME MATCHES SerenityOS) 172 - # FIXME: Something makes this go crazy and flag unused variables that aren't flagged as such when building with the toolchain. 173 - # Disable -Werror for now. 174 - add_compile_options(-Werror) 175 - endif() 176 - 177 - # The following warnings are sorted by the "base" name (the part excluding the initial Wno or W). 178 - add_compile_options(-Wno-address-of-packed-member) 179 - add_compile_options(-Wcast-qual) 180 - add_compile_options(-Wdeprecated-copy) 181 - add_compile_options(-Wduplicated-cond) 182 - add_compile_options(-Wformat=2) 183 - add_compile_options(-Wimplicit-fallthrough) 184 - add_compile_options(-Wlogical-op) 185 - add_compile_options(-Wmisleading-indentation) 186 - add_compile_options(-Wmissing-declarations) 187 - add_compile_options(-Wnon-virtual-dtor) 188 - add_compile_options(-Wsuggest-override) 189 - add_compile_options(-Wno-unknown-warning-option) 190 - add_compile_options(-Wundef) 191 - add_compile_options(-Wunused) 192 - add_compile_options(-Wno-unused-command-line-argument) 193 - add_compile_options(-Wwrite-strings) 194 - 195 - add_compile_options(-fdiagnostics-color=always) 196 - add_compile_options(-fno-delete-null-pointer-checks) 197 - add_compile_options(-ffile-prefix-map=${SerenityOS_SOURCE_DIR}=.) 198 - add_compile_options(-fno-exceptions) 199 - add_compile_options(-fno-semantic-interposition) 200 - add_compile_options(-fsized-deallocation) 201 - add_compile_options(-fstack-clash-protection) 202 - add_compile_options(-fstack-protector-strong) 203 - add_compile_options(-g1) 204 - 205 - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") 206 - add_compile_options(-Wno-literal-suffix) 207 - add_compile_options(-Wno-maybe-uninitialized) 208 - # Only ignore expansion-to-defined for g++, clang's implementation doesn't complain about function-like macros 209 - add_compile_options(-Wno-expansion-to-defined) 210 - add_compile_options(-Wcast-align) 211 - add_compile_options(-Wdouble-promotion) 212 - elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$") 213 - add_compile_options(-Wno-user-defined-literals) 214 - add_compile_options(-Wno-atomic-alignment) 215 - add_compile_options(-Wno-implicit-const-int-float-conversion) 216 - add_compile_options(-Wno-unused-const-variable) 217 - add_compile_options(-Wno-unused-private-field) 218 - add_compile_options(-fconstexpr-steps=16777216) 219 - 220 - # Clang doesn't add compiler_rt to the search path when compiling with -nostdlib. 221 - link_directories(${TOOLCHAIN_ROOT}/lib/clang/${CMAKE_CXX_COMPILER_VERSION}/lib/${SERENITY_ARCH}-pc-serenity/) 222 - endif() 164 + include(serenity_compile_options) 223 165 224 166 add_link_options(LINKER:-z,text) 225 167 add_link_options(LINKER:--no-allow-shlib-undefined)
+12
Meta/CMake/common_compile_options.cmake
··· 1 + set(CMAKE_CXX_STANDARD 20) 2 + set(CMAKE_CXX_STANDARD_REQUIRED ON) 3 + set(CMAKE_CXX_EXTENSIONS OFF) 4 + 5 + add_compile_options(-Wall) 6 + add_compile_options(-Wextra) 7 + 8 + if (NOT CMAKE_HOST_SYSTEM_NAME MATCHES SerenityOS) 9 + # FIXME: Something makes this go crazy and flag unused variables that aren't flagged as such when building with the toolchain. 10 + # Disable -Werror for now. 11 + add_compile_options(-Werror) 12 + endif()
+14
Meta/CMake/lagom_compile_options.cmake
··· 1 + include(${CMAKE_CURRENT_LIST_DIR}/common_compile_options.cmake) 2 + 3 + add_compile_options(-Wno-implicit-const-int-float-conversion) 4 + add_compile_options(-Wno-literal-suffix) 5 + add_compile_options(-Wno-maybe-uninitialized) 6 + add_compile_options(-Wno-unknown-warning-option) 7 + add_compile_options(-fsigned-char) 8 + add_compile_options(-fno-exceptions) 9 + add_compile_options(-fdiagnostics-color=always) 10 + add_compile_options(-fPIC -g) 11 + add_compile_options(-O2) 12 + if (NOT ENABLE_FUZZERS) 13 + add_compile_options(-fno-semantic-interposition) 14 + endif()
+48
Meta/CMake/serenity_compile_options.cmake
··· 1 + include(${CMAKE_CURRENT_LIST_DIR}/common_compile_options.cmake) 2 + 3 + # The following warnings are sorted by the "base" name (the part excluding the initial Wno or W). 4 + add_compile_options(-Wno-address-of-packed-member) 5 + add_compile_options(-Wcast-qual) 6 + add_compile_options(-Wdeprecated-copy) 7 + add_compile_options(-Wduplicated-cond) 8 + add_compile_options(-Wformat=2) 9 + add_compile_options(-Wimplicit-fallthrough) 10 + add_compile_options(-Wlogical-op) 11 + add_compile_options(-Wmisleading-indentation) 12 + add_compile_options(-Wmissing-declarations) 13 + add_compile_options(-Wnon-virtual-dtor) 14 + add_compile_options(-Wsuggest-override) 15 + add_compile_options(-Wno-unknown-warning-option) 16 + add_compile_options(-Wundef) 17 + add_compile_options(-Wunused) 18 + add_compile_options(-Wno-unused-command-line-argument) 19 + add_compile_options(-Wwrite-strings) 20 + 21 + add_compile_options(-fdiagnostics-color=always) 22 + add_compile_options(-fno-delete-null-pointer-checks) 23 + add_compile_options(-ffile-prefix-map=${SerenityOS_SOURCE_DIR}=.) 24 + add_compile_options(-fno-exceptions) 25 + add_compile_options(-fno-semantic-interposition) 26 + add_compile_options(-fsized-deallocation) 27 + add_compile_options(-fstack-clash-protection) 28 + add_compile_options(-fstack-protector-strong) 29 + add_compile_options(-g1) 30 + 31 + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") 32 + add_compile_options(-Wno-literal-suffix) 33 + add_compile_options(-Wno-maybe-uninitialized) 34 + # Only ignore expansion-to-defined for g++, clang's implementation doesn't complain about function-like macros 35 + add_compile_options(-Wno-expansion-to-defined) 36 + add_compile_options(-Wcast-align) 37 + add_compile_options(-Wdouble-promotion) 38 + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$") 39 + add_compile_options(-Wno-user-defined-literals) 40 + add_compile_options(-Wno-atomic-alignment) 41 + add_compile_options(-Wno-implicit-const-int-float-conversion) 42 + add_compile_options(-Wno-unused-const-variable) 43 + add_compile_options(-Wno-unused-private-field) 44 + add_compile_options(-fconstexpr-steps=16777216) 45 + 46 + # Clang doesn't add compiler_rt to the search path when compiling with -nostdlib. 47 + link_directories(${TOOLCHAIN_ROOT}/lib/clang/${CMAKE_CXX_COMPILER_VERSION}/lib/${SERENITY_ARCH}-pc-serenity/) 48 + endif()
+1 -16
Meta/Lagom/CMakeLists.txt
··· 60 60 endif() 61 61 62 62 include(wasm_spec_tests) 63 - 64 - add_compile_options(-fsigned-char) 65 - add_compile_options(-Wno-unknown-warning-option -Wno-literal-suffix -Wno-implicit-const-int-float-conversion) 66 - add_compile_options(-O2) 67 - add_compile_options(-Wall -Wextra -Werror) 68 - add_compile_options(-fPIC -g) 69 - add_compile_options(-Wno-maybe-uninitialized) 70 - add_compile_options(-fno-exceptions) 71 - add_compile_options(-fdiagnostics-color=always) 72 - if (NOT ENABLE_FUZZERS) 73 - add_compile_options(-fno-semantic-interposition) 74 - endif() 75 - 76 - set(CMAKE_CXX_STANDARD 20) 77 - set(CMAKE_CXX_STANDARD_REQUIRED ON) 78 - set(CMAKE_CXX_EXTENSIONS OFF) 63 + include(lagom_compile_options) 79 64 80 65 include(GNUInstallDirs) # make sure to include before we mess w/RPATH 81 66