cmake: Improved copy_headers.sh script, minor fixes. [#METR-21516]

This commit is contained in:
Vladimir Chebotarev 2016-12-06 21:04:10 +03:00
parent ca5c1dc31b
commit eb552f2943
7 changed files with 19 additions and 22 deletions

View File

@ -164,6 +164,7 @@ include (cmake/find_icu4c.cmake)
include (cmake/find_boost.cmake) include (cmake/find_boost.cmake)
include (cmake/find_libtool.cmake) include (cmake/find_libtool.cmake)
include (cmake/find_libmysqlclient.cmake) include (cmake/find_libmysqlclient.cmake)
include (cmake/find_rt.cmake)
# Directory for Yandex specific files # Directory for Yandex specific files
set (CLICKHOUSE_PRIVATE_DIR ${ClickHouse_SOURCE_DIR}/private/) set (CLICKHOUSE_PRIVATE_DIR ${ClickHouse_SOURCE_DIR}/private/)
@ -179,3 +180,5 @@ endif ()
message (STATUS "C_FLAGS: =${CMAKE_C_FLAGS}") message (STATUS "C_FLAGS: =${CMAKE_C_FLAGS}")
message (STATUS "CXX_FLAGS:=${CMAKE_CXX_FLAGS}") message (STATUS "CXX_FLAGS:=${CMAKE_CXX_FLAGS}")
include (cmake/print_include_directories.cmake)

10
cmake/find_rt.cmake Normal file
View File

@ -0,0 +1,10 @@
if (APPLE)
set (RT_LIBRARIES "apple_rt")
else ()
if (USE_STATIC_LIBRARIES)
set (RT_LIBRARIES "librt.a")
else ()
set (RT_LIBRARIES "rt")
endif ()
endif ()

View File

@ -0,0 +1,5 @@
get_property (dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/include_directories.txt "")
foreach (dir ${dirs})
file (APPEND ${CMAKE_CURRENT_BINARY_DIR}/include_directories.txt "-I ${dir} ")
endforeach ()

View File

@ -23,7 +23,7 @@ PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:$PATH"
# Опция -mcx16 для того, чтобы выбиралось больше заголовочных файлов (с запасом). # Опция -mcx16 для того, чтобы выбиралось больше заголовочных файлов (с запасом).
for src_file in $(clang -M -xc++ -std=gnu++1y -Wall -Werror -msse4 -mcx16 -mpopcnt -O3 -g -fPIC \ for src_file in $(clang -M -xc++ -std=gnu++1y -Wall -Werror -msse4 -mcx16 -mpopcnt -O3 -g -fPIC \
$(cat "$SOURCE_PATH/CMakeLists.txt" | grep include_directories | grep -v ClickHouse_BINARY_DIR | sed -e "s!\${ClickHouse_SOURCE_DIR}!$SOURCE_PATH!; s!include_directories (!-I !; s!)!!;" | tr '\n' ' ') \ $(cat "$SOURCE_PATH/build/include_directories.txt") \
"$SOURCE_PATH/dbms/include/DB/Interpreters/SpecializedAggregator.h" | "$SOURCE_PATH/dbms/include/DB/Interpreters/SpecializedAggregator.h" |
tr -d '\\' | tr -d '\\' |
grep -v '.o:' | grep -v '.o:' |

View File

@ -72,16 +72,6 @@ else ()
message (STATUS "Disabling libtcmalloc for valgrind better analysis") message (STATUS "Disabling libtcmalloc for valgrind better analysis")
endif () endif ()
if (APPLE)
set (RT_LIBRARIES "apple_rt")
else ()
if (USE_STATIC_LIBRARIES)
set (RT_LIBRARIES "librt.a")
else ()
set (RT_LIBRARIES "rt")
endif ()
endif ()
include (${ClickHouse_SOURCE_DIR}/cmake/find_glib.cmake) include (${ClickHouse_SOURCE_DIR}/cmake/find_glib.cmake)
target_link_libraries ( target_link_libraries (

View File

@ -8,12 +8,6 @@ add_executable (multi_version multi_version.cpp)
add_executable (json_test json_test.cpp) add_executable (json_test json_test.cpp)
add_executable (strong_typedef strong_typedef.cpp) add_executable (strong_typedef strong_typedef.cpp)
if (APPLE)
set (RT_LIBRARIES "")
else()
set (RT_LIBRARIES "rt")
endif()
target_link_libraries (date_lut_init common ${ICU_LIBS} dl) target_link_libraries (date_lut_init common ${ICU_LIBS} dl)
target_link_libraries (date_lut2 common ${ICU_LIBS} dl) target_link_libraries (date_lut2 common ${ICU_LIBS} dl)
target_link_libraries (date_lut3 common ${ICU_LIBS} dl) target_link_libraries (date_lut3 common ${ICU_LIBS} dl)

View File

@ -3,10 +3,5 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR})
add_executable (mysqlxx_test mysqlxx_test.cpp) add_executable (mysqlxx_test mysqlxx_test.cpp)
add_executable (failover failover.cpp) add_executable (failover failover.cpp)
if (APPLE)
set (RT_LIBRARIES "")
else()
set (RT_LIBRARIES "rt")
endif()
target_link_libraries (mysqlxx_test mysqlxx dbms ${RT_LIBRARIES}) target_link_libraries (mysqlxx_test mysqlxx dbms ${RT_LIBRARIES})
target_link_libraries (failover mysqlxx PocoUtil PocoFoundation ${RT_LIBRARIES}) target_link_libraries (failover mysqlxx PocoUtil PocoFoundation ${RT_LIBRARIES})