From 06c7d4315fa8492de260a3b359bdc3abcf9efab0 Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 11 Sep 2017 18:51:32 +0300 Subject: [PATCH] Cmake fixes (#CLICKHOUSE-3303) (#1229) * Cmake fixes (#CLICKHOUSE-3303) --- CMakeLists.txt | 5 +++-- cmake/find_ccache.cmake | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69b20377459..3e0fe38e84a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,7 @@ if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "None") message (STATUS "CMAKE_BUILD_TYPE is not set, set to default = RELWITHDEBINFO") set (CMAKE_BUILD_TYPE "RELWITHDEBINFO") endif () +string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC) message (STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} ) # ASan - build type with address sanitizer @@ -234,8 +235,8 @@ include (libs/libmysqlxx/cmake/find_mysqlclient.cmake) include (libs/libdaemon/cmake/find_unwind.cmake) -set (FULL_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}") -set (FULL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}") +set (FULL_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}") +set (FULL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UC}}") message (STATUS "C_FLAGS = ${FULL_C_FLAGS}") message (STATUS "CXX_FLAGS = ${FULL_CXX_FLAGS}") message (STATUS "LINK_FLAGS = ${CMAKE_EXE_LINKER_FLAGS}") diff --git a/cmake/find_ccache.cmake b/cmake/find_ccache.cmake index 926002a44ae..22372c3cbfe 100644 --- a/cmake/find_ccache.cmake +++ b/cmake/find_ccache.cmake @@ -3,9 +3,8 @@ find_program (CCACHE_FOUND ccache) if (CCACHE_FOUND AND NOT CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache" AND NOT CMAKE_CXX_COMPILER MATCHES "ccache") execute_process(COMMAND ${CCACHE_FOUND} "-V" OUTPUT_VARIABLE CCACHE_VERSION) string(REGEX REPLACE "ccache version ([0-9\\.]+).*" "\\1" CCACHE_VERSION ${CCACHE_VERSION} ) - string(COMPARE GREATER ${CCACHE_VERSION} "3.2.0" CCACHE_VERSION_OK) - if (CCACHE_VERSION_OK OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if (CCACHE_VERSION VERSION_GREATER "3.2.0" OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") #message(STATUS "Using ${CCACHE_FOUND} ${CCACHE_VERSION}") set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_FOUND}) set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_FOUND})