mirror of
https://github.com/ceph/ceph
synced 2024-12-30 07:23:11 +00:00
build: Uplevel to C++14
Fix a couple problems. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
parent
807152af2c
commit
70da1eed80
@ -78,7 +78,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
if(HAS_FORTIFY_SOURCE)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2")
|
||||
endif()
|
||||
endif()
|
||||
CHECK_C_COMPILER_FLAG(-fstack-protector-strong HAS_STACK_PROTECT)
|
||||
@ -140,15 +140,15 @@ else(no_yasm)
|
||||
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64")
|
||||
endif(no_yasm)
|
||||
|
||||
# require c++11
|
||||
# require c++14
|
||||
if(CMAKE_VERSION VERSION_LESS "3.1")
|
||||
include(CheckCXXCompilerFlag)
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||
if(NOT COMPILER_SUPPORTS_CXX11)
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
|
||||
if(NOT COMPILER_SUPPORTS_CXX14)
|
||||
message(FATAL_ERROR
|
||||
"The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
|
||||
"The compiler ${CMAKE_CXX_COMPILER} has no C++14 support.")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
||||
include(CheckCCompilerFlag)
|
||||
CHECK_C_COMPILER_FLAG("-std=gnu99" COMPILER_SUPPORTS_GNU99)
|
||||
if(NOT COMPILER_SUPPORTS_GNU99)
|
||||
@ -157,7 +157,7 @@ if(CMAKE_VERSION VERSION_LESS "3.1")
|
||||
endif()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
@ -577,7 +577,7 @@ C_OrderedThrottle *OrderedThrottle::start_op(Context *on_finish) {
|
||||
auto l = uniquely_lock(m_lock);
|
||||
uint64_t tid = m_next_tid++;
|
||||
m_tid_result[tid] = Result(on_finish);
|
||||
auto ctx = make_unique<C_OrderedThrottle>(this, tid);
|
||||
auto ctx = std::make_unique<C_OrderedThrottle>(this, tid);
|
||||
|
||||
complete_pending_ops(l);
|
||||
while (m_max == m_current) {
|
||||
|
@ -878,7 +878,7 @@ bool ParseState::obj_start() {
|
||||
if (w->objectable && !objecting) {
|
||||
objecting = true;
|
||||
if (w->id == TokenID::Statement) {
|
||||
pp->policy.statements.push_back({});
|
||||
pp->policy.statements.emplace_back();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user