Dynamic library mode (#471)

* Cmake: UNBUNDLED option

* Dynamic library mode
This commit is contained in:
proller 2017-02-08 21:53:00 +03:00 committed by alexey-milovidov
parent 131283de5b
commit 9bbe8fe5c4
6 changed files with 16 additions and 12 deletions

View File

@ -137,6 +137,11 @@ if (USE_STATIC_LIBRARIES AND HAVE_NO_PIE)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG_NO_PIE}")
endif ()
if (NOT USE_STATIC_LIBRARIES)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif ()
set (SAN_FLAGS "-O3 -g -fno-omit-frame-pointer")
set (CMAKE_CXX_FLAGS_ASAN "${CMAKE_CXX_FLAGS_ASAN} ${SAN_FLAGS} -fsanitize=address")
set (CMAKE_C_FLAGS_ASAN "${CMAKE_C_FLAGS_ASAN} ${SAN_FLAGS} -fsanitize=address")

View File

@ -11,5 +11,5 @@ endif ()
macro (add_check target)
add_test (NAME test_${target} COMMAND ${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_dependencies (check ${target})
#add_dependencies (check ${target})
endmacro (add_check)

View File

@ -29,7 +29,7 @@ find_path(ODBC_INCLUDE_DIRECTORIES
)
find_library(ODBC_LIBRARIES
NAMES libiodbc.a iodbc libodbc.a odbc odbcinst odbc32
NAMES iodbc odbc odbcinst odbc32
HINTS
/usr/lib
/usr/lib/odbc

View File

@ -70,7 +70,15 @@ if (APPLE OR CMAKE_SYSTEM MATCHES "FreeBSD")
src/IO/WriteBufferAIO.cpp)
endif()
add_library(dbms ${dbms_headers} ${dbms_sources})
include (${CMAKE_SOURCE_DIR}/libs/libcommon/cmake/version.cmake)
if (USE_STATIC_LIBRARIES)
add_library(dbms ${dbms_headers} ${dbms_sources})
else ()
add_library(dbms SHARED ${dbms_headers} ${dbms_sources})
set_target_properties (dbms PROPERTIES SOVERSION ${VERSION_MAJOR} VERSION ${VERSION_STRING} OUTPUT_NAME clickhouse)
install (TARGETS dbms LIBRARY DESTINATION lib COMPONENT clickhouse)
endif ()
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
@ -146,7 +154,3 @@ target_link_libraries(dbms
${LTDL_LIB}
${CMAKE_THREAD_LIBS_INIT}
)
add_dependencies (dbms
common
zkutil)

View File

@ -34,8 +34,6 @@ add_library (mysqlxx
include/mysqlxx/Value.h
)
add_dependencies (mysqlxx common)
set(PLATFORM_LIBS ${CMAKE_DL_LIBS})
if (USE_STATIC_LIBRARIES)

View File

@ -8,7 +8,4 @@ add_library (pocoext
include/Poco/Ext/LevelFilterChannel.h
include/Poco/Ext/ThreadNumber.h)
if (USE_INTERNAL_POCO_LIBRARY)
add_dependencies (pocoext ${Poco_Util_LIBRARY} ${Poco_Net_LIBRARY} ${Poco_XML_LIBRARY} ${Poco_Foundation_LIBRARY})
endif ()
target_link_libraries(pocoext ${Poco_Util_LIBRARY} ${Poco_Net_LIBRARY} ${Poco_XML_LIBRARY} ${Poco_Foundation_LIBRARY})