···129129130130endif()
131131132132-set(CMAKE_CXX_STANDARD 20)
133133-set(CMAKE_CXX_STANDARD_REQUIRED ON)
134134-set(CMAKE_CXX_EXTENSIONS OFF)
135135-136132if (ENABLE_ALL_DEBUG_FACILITIES)
137133 set(ENABLE_ALL_THE_DEBUG_MACROS ON)
138134 set(ENABLE_EXTRA_KERNEL_DEBUG_SYMBOLS ON)
···165161# This will need to be revisited when the Loader supports RPATH/RUN_PATH.
166162set(CMAKE_SKIP_RPATH TRUE)
167163168168-add_compile_options(-Wall)
169169-add_compile_options(-Wextra)
170170-171171-if (NOT CMAKE_HOST_SYSTEM_NAME MATCHES SerenityOS)
172172- # FIXME: Something makes this go crazy and flag unused variables that aren't flagged as such when building with the toolchain.
173173- # Disable -Werror for now.
174174- add_compile_options(-Werror)
175175-endif()
176176-177177-# The following warnings are sorted by the "base" name (the part excluding the initial Wno or W).
178178-add_compile_options(-Wno-address-of-packed-member)
179179-add_compile_options(-Wcast-qual)
180180-add_compile_options(-Wdeprecated-copy)
181181-add_compile_options(-Wduplicated-cond)
182182-add_compile_options(-Wformat=2)
183183-add_compile_options(-Wimplicit-fallthrough)
184184-add_compile_options(-Wlogical-op)
185185-add_compile_options(-Wmisleading-indentation)
186186-add_compile_options(-Wmissing-declarations)
187187-add_compile_options(-Wnon-virtual-dtor)
188188-add_compile_options(-Wsuggest-override)
189189-add_compile_options(-Wno-unknown-warning-option)
190190-add_compile_options(-Wundef)
191191-add_compile_options(-Wunused)
192192-add_compile_options(-Wno-unused-command-line-argument)
193193-add_compile_options(-Wwrite-strings)
194194-195195-add_compile_options(-fdiagnostics-color=always)
196196-add_compile_options(-fno-delete-null-pointer-checks)
197197-add_compile_options(-ffile-prefix-map=${SerenityOS_SOURCE_DIR}=.)
198198-add_compile_options(-fno-exceptions)
199199-add_compile_options(-fno-semantic-interposition)
200200-add_compile_options(-fsized-deallocation)
201201-add_compile_options(-fstack-clash-protection)
202202-add_compile_options(-fstack-protector-strong)
203203-add_compile_options(-g1)
204204-205205-if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
206206- add_compile_options(-Wno-literal-suffix)
207207- add_compile_options(-Wno-maybe-uninitialized)
208208- # Only ignore expansion-to-defined for g++, clang's implementation doesn't complain about function-like macros
209209- add_compile_options(-Wno-expansion-to-defined)
210210- add_compile_options(-Wcast-align)
211211- add_compile_options(-Wdouble-promotion)
212212-elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
213213- add_compile_options(-Wno-user-defined-literals)
214214- add_compile_options(-Wno-atomic-alignment)
215215- add_compile_options(-Wno-implicit-const-int-float-conversion)
216216- add_compile_options(-Wno-unused-const-variable)
217217- add_compile_options(-Wno-unused-private-field)
218218- add_compile_options(-fconstexpr-steps=16777216)
219219-220220- # Clang doesn't add compiler_rt to the search path when compiling with -nostdlib.
221221- link_directories(${TOOLCHAIN_ROOT}/lib/clang/${CMAKE_CXX_COMPILER_VERSION}/lib/${SERENITY_ARCH}-pc-serenity/)
222222-endif()
164164+include(serenity_compile_options)
223165224166add_link_options(LINKER:-z,text)
225167add_link_options(LINKER:--no-allow-shlib-undefined)
+12
Meta/CMake/common_compile_options.cmake
···11+set(CMAKE_CXX_STANDARD 20)
22+set(CMAKE_CXX_STANDARD_REQUIRED ON)
33+set(CMAKE_CXX_EXTENSIONS OFF)
44+55+add_compile_options(-Wall)
66+add_compile_options(-Wextra)
77+88+if (NOT CMAKE_HOST_SYSTEM_NAME MATCHES SerenityOS)
99+ # FIXME: Something makes this go crazy and flag unused variables that aren't flagged as such when building with the toolchain.
1010+ # Disable -Werror for now.
1111+ add_compile_options(-Werror)
1212+endif()