mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Run check_*_compiler_flag earlier
This commit is contained in:
parent
41012b5ba4
commit
d22ab2028f
@ -593,6 +593,9 @@ include_directories(${ConfigIncludePath})
|
||||
# Add as many warnings as possible for our own code.
|
||||
include (cmake/warnings.cmake)
|
||||
|
||||
# Check if needed compiler flags are supported
|
||||
include (cmake/check_flags.cmake)
|
||||
|
||||
add_subdirectory (base)
|
||||
add_subdirectory (src)
|
||||
add_subdirectory (programs)
|
||||
|
7
cmake/check_flags.cmake
Normal file
7
cmake/check_flags.cmake
Normal file
@ -0,0 +1,7 @@
|
||||
include (CheckCXXCompilerFlag)
|
||||
include (CheckCCompilerFlag)
|
||||
|
||||
check_cxx_compiler_flag("-Wsuggest-destructor-override" HAS_SUGGEST_DESTRUCTOR_OVERRIDE)
|
||||
check_cxx_compiler_flag("-Wshadow" HAS_SHADOW)
|
||||
check_cxx_compiler_flag("-Wsuggest-override" HAS_SUGGEST_OVERRIDE)
|
||||
check_cxx_compiler_flag("-Wsuggest-destructor-override" HAS_SUGGEST_DESTRUCTOR_OVERRIDE)
|
@ -3,9 +3,6 @@ add_headers_and_sources(clickhouse_functions_gatherutils .)
|
||||
add_library(clickhouse_functions_gatherutils ${clickhouse_functions_gatherutils_sources} ${clickhouse_functions_gatherutils_headers})
|
||||
target_link_libraries(clickhouse_functions_gatherutils PRIVATE dbms)
|
||||
|
||||
check_cxx_compiler_flag("-Wsuggest-override" HAS_SUGGEST_OVERRIDE)
|
||||
check_cxx_compiler_flag("-Wsuggest-destructor-override" HAS_SUGGEST_DESTRUCTOR_OVERRIDE)
|
||||
|
||||
if (HAS_SUGGEST_OVERRIDE)
|
||||
target_compile_definitions(clickhouse_functions_gatherutils PUBLIC HAS_SUGGEST_OVERRIDE)
|
||||
endif()
|
||||
|
@ -50,12 +50,6 @@ set (SRCS
|
||||
|
||||
add_library (clickhouse_parsers_new ${SRCS})
|
||||
|
||||
# XXX: hack for old clang-10!
|
||||
check_cxx_compiler_flag("-Wsuggest-destructor-override" HAS_SUGGEST_DESTRUCTOR_OVERRIDE)
|
||||
|
||||
# XXX: hack for old gcc-10!
|
||||
check_cxx_compiler_flag("-Wshadow" HAS_SHADOW)
|
||||
|
||||
target_compile_options (clickhouse_parsers_new
|
||||
PRIVATE
|
||||
-Wno-c++2a-compat
|
||||
@ -68,12 +62,16 @@ target_compile_options (clickhouse_parsers_new
|
||||
-Wno-extra-semi
|
||||
-Wno-inconsistent-missing-destructor-override
|
||||
)
|
||||
|
||||
# XXX: hack for old clang-10!
|
||||
if (HAS_SUGGEST_DESTRUCTOR_OVERRIDE)
|
||||
target_compile_options (clickhouse_parsers_new
|
||||
PRIVATE
|
||||
-Wno-suggest-destructor-override
|
||||
)
|
||||
endif ()
|
||||
|
||||
# XXX: hack for old gcc-10!
|
||||
if (HAS_SHADOW)
|
||||
target_compile_options (clickhouse_parsers_new
|
||||
PRIVATE
|
||||
|
Loading…
Reference in New Issue
Block a user