This commit is contained in:
Amos Bird 2019-12-29 00:42:58 +08:00
parent b75771be61
commit bbc736f2d9
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
9 changed files with 16 additions and 8 deletions

View File

@ -176,7 +176,9 @@ if (ARCH_NATIVE)
set (COMPILER_FLAGS "${COMPILER_FLAGS} -march=native") set (COMPILER_FLAGS "${COMPILER_FLAGS} -march=native")
endif () endif ()
set (CMAKE_CXX_STANDARD 17) # cmake < 3.12 doesn't supoprt 20. We'll set CMAKE_CXX_FLAGS for now
# set (CMAKE_CXX_STANDARD 20)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++2a")
set (CMAKE_CXX_EXTENSIONS 0) # https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html#prop_tgt:CXX_EXTENSIONS set (CMAKE_CXX_EXTENSIONS 0) # https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html#prop_tgt:CXX_EXTENSIONS
set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_STANDARD_REQUIRED ON)

View File

@ -2,10 +2,10 @@
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -std=c++1z") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -std=c++1z") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
endif () endif ()
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1) set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1)

View File

@ -1,5 +1,7 @@
include(ExternalProject) include(ExternalProject)
set (CMAKE_CXX_STANDARD 17)
# === thrift # === thrift
set(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/thrift/lib/cpp) set(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/thrift/lib/cpp)

View File

@ -1,5 +1,7 @@
set (CAPNPROTO_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/capnproto/c++/src) set (CAPNPROTO_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/capnproto/c++/src)
set (CMAKE_CXX_STANDARD 17)
set (KJ_SRCS set (KJ_SRCS
${CAPNPROTO_SOURCE_DIR}/kj/array.c++ ${CAPNPROTO_SOURCE_DIR}/kj/array.c++
${CAPNPROTO_SOURCE_DIR}/kj/common.c++ ${CAPNPROTO_SOURCE_DIR}/kj/common.c++

View File

@ -1,6 +1,8 @@
set(ICU_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/icu/icu4c/source) set(ICU_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/icu/icu4c/source)
set(ICUDATA_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/icudata/) set(ICUDATA_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/icudata/)
set (CMAKE_CXX_STANDARD 17)
# These lists of sources were generated from build log of the original ICU build system (configure + make). # These lists of sources were generated from build log of the original ICU build system (configure + make).
set(ICUUC_SOURCES set(ICUUC_SOURCES

View File

@ -129,7 +129,7 @@ void PushingToViewsBlockOutputStream::write(const Block & block)
for (size_t view_num = 0; view_num < views.size(); ++view_num) for (size_t view_num = 0; view_num < views.size(); ++view_num)
{ {
auto thread_group = CurrentThread::getGroup(); auto thread_group = CurrentThread::getGroup();
pool.scheduleOrThrowOnError([=] pool.scheduleOrThrowOnError([=, this]
{ {
setThreadName("PushingToViews"); setThreadName("PushingToViews");
if (thread_group) if (thread_group)

View File

@ -72,7 +72,7 @@ bool EmbeddedDictionaries::reloadImpl(const bool throw_on_error, const bool forc
bool was_exception = false; bool was_exception = false;
DictionaryReloader<RegionsHierarchies> reload_regions_hierarchies = [=] (const Poco::Util::AbstractConfiguration & config) DictionaryReloader<RegionsHierarchies> reload_regions_hierarchies = [=, this] (const Poco::Util::AbstractConfiguration & config)
{ {
return geo_dictionaries_loader->reloadRegionsHierarchies(config); return geo_dictionaries_loader->reloadRegionsHierarchies(config);
}; };
@ -80,7 +80,7 @@ bool EmbeddedDictionaries::reloadImpl(const bool throw_on_error, const bool forc
if (!reloadDictionary<RegionsHierarchies>(regions_hierarchies, std::move(reload_regions_hierarchies), throw_on_error, force_reload)) if (!reloadDictionary<RegionsHierarchies>(regions_hierarchies, std::move(reload_regions_hierarchies), throw_on_error, force_reload))
was_exception = true; was_exception = true;
DictionaryReloader<RegionsNames> reload_regions_names = [=] (const Poco::Util::AbstractConfiguration & config) DictionaryReloader<RegionsNames> reload_regions_names = [=, this] (const Poco::Util::AbstractConfiguration & config)
{ {
return geo_dictionaries_loader->reloadRegionsNames(config); return geo_dictionaries_loader->reloadRegionsNames(config);
}; };

View File

@ -252,7 +252,7 @@ BlockInputStreams StorageMerge::read(
else else
{ {
source_streams.emplace_back(std::make_shared<LazyBlockInputStream>( source_streams.emplace_back(std::make_shared<LazyBlockInputStream>(
header, [=]() mutable -> BlockInputStreamPtr header, [=, this]() mutable -> BlockInputStreamPtr
{ {
BlockInputStreams streams = createSourceStreams(query_info, processed_stage, max_block_size, BlockInputStreams streams = createSourceStreams(query_info, processed_stage, max_block_size,
header, storage, struct_lock, real_column_names, header, storage, struct_lock, real_column_names,

View File

@ -209,7 +209,7 @@ public:
/// This allows to receive more signals if failure happens inside onFault function. /// This allows to receive more signals if failure happens inside onFault function.
/// Example: segfault while symbolizing stack trace. /// Example: segfault while symbolizing stack trace.
std::thread([=] { onFault(sig, info, context, stack_trace, thread_num, query_id); }).detach(); std::thread([=, this] { onFault(sig, info, context, stack_trace, thread_num, query_id); }).detach();
} }
} }
} }