mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Build: Make things build with clang without needing local changes
Useful for sanitizer fuzzer builds. clang doesn't have a -fconcepts switch (I'm guessing it just enables concepts automatically with -std=c++2a, but I haven't checked), and at least the version on my system doesn't understand -Wno-deprecated-move, so pass these two flags only to gcc. In return, disable -Woverloaded-virtual which fires in many places. The preceding commits fixed the handful of -Wunused-private-field warnings that clang emitted.
This commit is contained in:
parent
5f109c1885
commit
a619943001
Notes:
sideshowbarker
2024-07-19 04:19:37 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/a619943001b Pull-request: https://github.com/SerenityOS/serenity/pull/2986
2 changed files with 11 additions and 3 deletions
|
@ -40,7 +40,12 @@ add_custom_target(check-style
|
||||||
USES_TERMINAL
|
USES_TERMINAL
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -std=c++2a -fdiagnostics-color=always -fconcepts")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++2a -fdiagnostics-color=always")
|
||||||
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fconcepts")
|
||||||
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-overloaded-virtual")
|
||||||
|
endif()
|
||||||
|
|
||||||
include_directories(Libraries)
|
include_directories(Libraries)
|
||||||
include_directories(.)
|
include_directories(.)
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
cmake_minimum_required (VERSION 3.0)
|
cmake_minimum_required (VERSION 3.0)
|
||||||
project (Lagom)
|
project (Lagom)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -Wextra -Werror -std=c++2a -fPIC -g -Wno-deprecated-copy")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -Wextra -Werror -std=c++2a -fPIC -g")
|
||||||
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy")
|
||||||
|
endif()
|
||||||
|
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconsumed")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconsumed -Wno-overloaded-virtual")
|
||||||
|
|
||||||
option(ENABLE_ADDRESS_SANITIZER "Enable address sanitizer testing in gcc/clang" FALSE)
|
option(ENABLE_ADDRESS_SANITIZER "Enable address sanitizer testing in gcc/clang" FALSE)
|
||||||
if (ENABLE_ADDRESS_SANITIZER)
|
if (ENABLE_ADDRESS_SANITIZER)
|
||||||
|
|
Loading…
Reference in a new issue