Fix odbc include, clang-format fixes, misc (#484)

* Cmake: fix fallback to internal libs if no external found

* wip

* style

* fix
This commit is contained in:
proller 2017-02-13 16:59:34 +03:00 committed by alexey-milovidov
parent 8f9b70a1d7
commit f8d2f19280
5 changed files with 15 additions and 11 deletions

View File

@ -4,7 +4,7 @@ Language: Cpp
AlignAfterOpenBracket: false
BreakBeforeBraces: Allman
BreakConstructorInitializersBeforeComma: false
Cpp11BracedListStyle: false
Cpp11BracedListStyle: true
ColumnLimit: 140
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ExperimentalAutoDetectBinPacking: true
@ -17,6 +17,7 @@ KeepEmptyLinesAtTheStartOfBlocks: false
#AllowShortFunctionsOnASingleLine: Inline
AllowShortFunctionsOnASingleLine: Empty
AlwaysBreakTemplateDeclarations: true
IndentCaseLabels: true
#SpaceAfterTemplateKeyword: true
SortIncludes: true
IncludeCategories:
@ -59,7 +60,6 @@ ContinuationIndentWidth: 4
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
MacroBlockBegin: ''

View File

@ -3,7 +3,6 @@ cmake_minimum_required (VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${ClickHouse_SOURCE_DIR}/cmake/Modules/")
message(STATUS "Building for: ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_LIBRARY_ARCHITECTURE}")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Require at least gcc 5
@ -62,6 +61,8 @@ else ()
set(NOT_UNBUNDLED 1)
endif ()
message (STATUS "Building for: ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_LIBRARY_ARCHITECTURE} ; USE_STATIC_LIBRARIES=${USE_STATIC_LIBRARIES} UNBUNDLED=${UNBUNDLED}")
option (USE_INTERNAL_BOOST_LIBRARY "Set to FALSE to use system boost library instead of bundled" ${NOT_UNBUNDLED})
if (USE_INTERNAL_BOOST_LIBRARY)
@ -71,11 +72,13 @@ endif ()
option (USE_INTERNAL_POCO_LIBRARY "Set to FALSE to use system poco library instead of bundled" ${NOT_UNBUNDLED})
if (CMAKE_SYSTEM MATCHES "FreeBSD")
option (USE_INTERNAL_GPERFTOOLS_LIBRARY "Set to FALSE to use system gperftools (tcmalloc) library instead of bundled" OFF)
set(NOT_FREEBSD 0)
else ()
option (USE_INTERNAL_GPERFTOOLS_LIBRARY "Set to FALSE to use system gperftools (tcmalloc) library instead of bundled" ON)
set(NOT_FREEBSD 1)
endif ()
option (USE_INTERNAL_GPERFTOOLS_LIBRARY "Set to FALSE to use system gperftools (tcmalloc) library instead of bundled" ${NOT_FREEBSD})
option (USE_INTERNAL_ZLIB_LIBRARY "Set to FALSE to use system zlib library instead of bundled" ${NOT_UNBUNDLED})
option (ENABLE_LIBTCMALLOC "Set to TRUE to enable libtcmalloc." ON)
@ -138,8 +141,7 @@ if (USE_STATIC_LIBRARIES AND HAVE_NO_PIE)
endif ()
if (NOT USE_STATIC_LIBRARIES)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif ()
set (SAN_FLAGS "-O3 -g -fno-omit-frame-pointer")
@ -192,8 +194,8 @@ include (cmake/find_readline_edit.cmake)
include (cmake/find_gperftools.cmake)
include (cmake/find_jemalloc.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}}")
set (FULL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}")
message (STATUS "C_FLAGS = ${FULL_C_FLAGS}")
message (STATUS "CXX_FLAGS = ${FULL_CXX_FLAGS}")
message (STATUS "LINK_FLAGS = ${CMAKE_EXE_LINKER_FLAGS}")

View File

@ -10,6 +10,7 @@ include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libsparsehash)
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libre2/)
include_directories (BEFORE ${ClickHouse_BINARY_DIR}/contrib/libre2/)
include_directories (${ClickHouse_SOURCE_DIR}/libs/libdaemon/include/)
include_directories (${ODBC_INCLUDE_DIRECTORIES})
if (NOT NO_WERROR)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")

View File

@ -1,5 +1,6 @@
#include <DB/Core/Block.h>
#include <DB/Dictionaries/DictionarySourceFactory.h>
#include <DB/Core/Block.h>
#include <DB/Dictionaries/DictionaryStructure.h>
#include <DB/Dictionaries/FileDictionarySource.h>
#include <DB/Dictionaries/MySQLDictionarySource.h>
@ -11,7 +12,6 @@
#include <DB/DataTypes/DataTypesNumberFixed.h>
#include <DB/DataTypes/DataTypeDate.h>
#include <DB/Core/FieldVisitors.h>
#include <memory>
#include <Poco/Data/ODBC/Connector.h>

View File

@ -21,4 +21,5 @@ const std::vector<const char *> auto_config_build {
"LINK_FLAGS", "@CMAKE_EXE_LINKER_FLAGS@",
"BUILD_COMPILE_DEFINITIONS", "@BUILD_COMPILE_DEFINITIONS@",
"BUILD_INCLUDE_DIRECTORIES", "@BUILD_INCLUDE_DIRECTORIES@",
"STATIC", "@USE_STATIC_LIBRARIES@",
};