From d940d1713c4673687c16ae501315e1a54a159734 Mon Sep 17 00:00:00 2001 From: proller Date: Fri, 3 Nov 2017 00:30:27 +0300 Subject: [PATCH] Cmake: silent poco warnings, use compiler version defenition by cmake (#1440) Cmake: silent poco warnings, use compiler version definition by cmake --- CMakeLists.txt | 10 +++++++++- contrib/poco | 2 +- dbms/src/Interpreters/CMakeLists.txt | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 28a2ea96a89..07e77e88028 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,8 +114,16 @@ endif () # set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-unused-command-line-argument -mllvm -inline-threshold=10000") #endif () +if (CMAKE_VERSION VERSION_LESS "3.8.0") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++1z") +else () + set (CMAKE_CXX_STANDARD 17) + set (CMAKE_CXX_STANDARD_REQUIRED ON) + set (CXX_FLAGS_INTERNAL_COMPILER "-std=gnu++1z") +endif () + set (CMAKE_BUILD_COLOR_MAKEFILE ON) -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS} -std=gnu++1z ${PLATFORM_EXTRA_CXX_FLAG} -fno-omit-frame-pointer ${COMMON_WARNING_FLAGS} ${CXX_WARNING_FLAGS} ${GLIBC_COMPATIBILITY_COMPILE_FLAGS}") +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS} ${PLATFORM_EXTRA_CXX_FLAG} -fno-omit-frame-pointer ${COMMON_WARNING_FLAGS} ${CXX_WARNING_FLAGS} ${GLIBC_COMPATIBILITY_COMPILE_FLAGS}") #set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3") set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g3 -ggdb3 -fno-inline") diff --git a/contrib/poco b/contrib/poco index 1366df1c7e0..677e62674cf 160000 --- a/contrib/poco +++ b/contrib/poco @@ -1 +1 @@ -Subproject commit 1366df1c7e068bb2efd846bc8dc8e286b090904e +Subproject commit 677e62674cf98be3463a1bdb9d279f576dd66f97 diff --git a/dbms/src/Interpreters/CMakeLists.txt b/dbms/src/Interpreters/CMakeLists.txt index 2e34a62a60c..4a540c12861 100644 --- a/dbms/src/Interpreters/CMakeLists.txt +++ b/dbms/src/Interpreters/CMakeLists.txt @@ -15,7 +15,7 @@ set (INTERNAL_COMPILER_NO_WARNING OFF CACHE BOOL "") #original string: # -x c++ -std=gnu++1y -O3 -g -Wall -Werror -Wnon-virtual-dtor -march=native -msse4 -mpopcnt -D NDEBUG -D_GLIBCXX_USE_CXX11_ABI=0 -shared -fPIC -fvisibility=hidden -fno-implement-inlines -set (INTERNAL_COMPILER_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -x c++ -march=native -shared -fPIC -fvisibility=hidden -fno-implement-inlines " CACHE STRING "") +set (INTERNAL_COMPILER_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} ${CXX_FLAGS_INTERNAL_COMPILER} -x c++ -march=native -shared -fPIC -fvisibility=hidden -fno-implement-inlines " CACHE STRING "") string(REPLACE "-no-pie" "" INTERNAL_COMPILER_FLAGS ${INTERNAL_COMPILER_FLAGS}) if (INTERNAL_COMPILER_NO_WARNING) string (REPLACE "-Wall" "" INTERNAL_COMPILER_FLAGS ${INTERNAL_COMPILER_FLAGS})