module: Silent noisy cpp warnings

Mostly caused by Dobby and there is no need to take care of them.

Signed-off-by: GarfieldHan <2652609017@qq.com>
This commit is contained in:
GarfieldHan
2024-07-18 11:02:14 +08:00
parent 1035103e15
commit 7ce469ea1d
2 changed files with 29 additions and 4 deletions

View File

@@ -57,7 +57,26 @@ cmaker {
cFlags += releaseFlags
}
}
cppFlags += "--std=c++23"
val commonFlags = arrayOf(
// Silent noisy warnings
"-Wno-reorder-ctor",
"-Wno-overloaded-virtual",
"-Wno-unused-function",
"-Wno-unused-but-set-variable",
"-Wno-unused-private-field",
"-Wno-missing-braces",
"-Wno-delete-non-abstract-non-virtual-dtor",
"-Wno-unused-variable",
"-Wno-sometimes-uninitialized",
"-Wno-logical-op-parentheses",
"-Wno-shift-count-overflow",
"-Wno-deprecated-declarations",
"-Wno-infinite-recursion",
"-Wno-format",
"-Wno-deprecated-volatile",
)
cppFlags += commonFlags
cFlags += commonFlags
}
}

View File

@@ -1,14 +1,20 @@
cmake_minimum_required(VERSION 3.28)
project(sample)
if (CCACHE)
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
endif ()
find_package(cxx REQUIRED CONFIG)
link_libraries(cxx::cxx)
find_program(CCACHE ccache)
set(LINKER_FLAGS "-ffixed-x18 -Wl,--hash-style=both")
set(CXX_FLAGS "${CXX_FLAGS} -fno-exceptions -fno-rtti")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS}")
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")