mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 04:12:19 +00:00
Clean CMakeLists
This commit is contained in:
parent
daf84d4b84
commit
055ec8817b
@ -289,7 +289,7 @@ if (OS_LINUX AND NOT UNBUNDLED AND (GLIBC_COMPATIBILITY OR USE_INTERNAL_UNWIND_L
|
|||||||
|
|
||||||
if (USE_INTERNAL_UNWIND_LIBRARY_FOR_EXCEPTION_HANDLING)
|
if (USE_INTERNAL_UNWIND_LIBRARY_FOR_EXCEPTION_HANDLING)
|
||||||
# TODO: Allow to use non-static library as well.
|
# TODO: Allow to use non-static library as well.
|
||||||
set (EXCEPTION_HANDLING_LIBRARY "lib/libunwind${${CMAKE_POSTFIX_VARIABLE}}.a")
|
set (EXCEPTION_HANDLING_LIBRARY "${ClickHouse_BINARY_DIR}/contrib/libunwind-cmake/libunwind_static${${CMAKE_POSTFIX_VARIABLE}}.a")
|
||||||
else ()
|
else ()
|
||||||
set (EXCEPTION_HANDLING_LIBRARY "-lgcc_eh")
|
set (EXCEPTION_HANDLING_LIBRARY "-lgcc_eh")
|
||||||
endif ()
|
endif ()
|
||||||
@ -298,7 +298,7 @@ if (OS_LINUX AND NOT UNBUNDLED AND (GLIBC_COMPATIBILITY OR USE_INTERNAL_UNWIND_L
|
|||||||
|
|
||||||
if (USE_LIBCXX)
|
if (USE_LIBCXX)
|
||||||
if (USE_INTERNAL_LIBCXX_LIBRARY)
|
if (USE_INTERNAL_LIBCXX_LIBRARY)
|
||||||
set (LIBCXX_LIBS "lib/libc++${${CMAKE_POSTFIX_VARIABLE}}.a lib/libc++abi${${CMAKE_POSTFIX_VARIABLE}}.a")
|
set (LIBCXX_LIBS "${ClickHouse_BINARY_DIR}/contrib/libcxx-cmake/libcxx_static${${CMAKE_POSTFIX_VARIABLE}}.a ${ClickHouse_BINARY_DIR}/contrib/libcxxabi-cmake/libcxxabi_static${${CMAKE_POSTFIX_VARIABLE}}.a")
|
||||||
else ()
|
else ()
|
||||||
set (LIBCXX_LIBS "-lc++ -lc++abi")
|
set (LIBCXX_LIBS "-lc++ -lc++abi")
|
||||||
endif ()
|
endif ()
|
||||||
@ -481,7 +481,7 @@ if (GLIBC_COMPATIBILITY OR USE_INTERNAL_UNWIND_LIBRARY_FOR_EXCEPTION_HANDLING)
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (USE_INTERNAL_UNWIND_LIBRARY_FOR_EXCEPTION_HANDLING)
|
if (USE_INTERNAL_UNWIND_LIBRARY_FOR_EXCEPTION_HANDLING)
|
||||||
add_dependencies(${target_name} ${UNWIND_LIBRARY})
|
add_dependencies(${target_name} unwind_static)
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
26
contrib/CMakeLists.txt
vendored
26
contrib/CMakeLists.txt
vendored
@ -10,6 +10,20 @@ endif ()
|
|||||||
|
|
||||||
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1)
|
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1)
|
||||||
|
|
||||||
|
|
||||||
|
if (USE_INTERNAL_UNWIND_LIBRARY)
|
||||||
|
add_subdirectory (libunwind-cmake)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (USE_LIBCXX AND USE_INTERNAL_LIBCXXABI_LIBRARY)
|
||||||
|
add_subdirectory(libcxxabi-cmake)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (USE_LIBCXX AND USE_INTERNAL_LIBCXX_LIBRARY)
|
||||||
|
add_subdirectory(libcxx-cmake)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if (USE_INTERNAL_BOOST_LIBRARY)
|
if (USE_INTERNAL_BOOST_LIBRARY)
|
||||||
add_subdirectory (boost-cmake)
|
add_subdirectory (boost-cmake)
|
||||||
endif ()
|
endif ()
|
||||||
@ -52,10 +66,6 @@ if (USE_INTERNAL_BTRIE_LIBRARY)
|
|||||||
add_subdirectory (libbtrie)
|
add_subdirectory (libbtrie)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (USE_INTERNAL_UNWIND_LIBRARY)
|
|
||||||
add_subdirectory (libunwind)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (USE_INTERNAL_ZLIB_LIBRARY)
|
if (USE_INTERNAL_ZLIB_LIBRARY)
|
||||||
set (ZLIB_ENABLE_TESTS 0 CACHE INTERNAL "")
|
set (ZLIB_ENABLE_TESTS 0 CACHE INTERNAL "")
|
||||||
set (SKIP_INSTALL_ALL 1 CACHE INTERNAL "")
|
set (SKIP_INSTALL_ALL 1 CACHE INTERNAL "")
|
||||||
@ -281,14 +291,6 @@ if (USE_INTERNAL_LLVM_LIBRARY)
|
|||||||
add_subdirectory (llvm/llvm)
|
add_subdirectory (llvm/llvm)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (USE_LIBCXX AND USE_INTERNAL_LIBCXXABI_LIBRARY)
|
|
||||||
add_subdirectory(libcxxabi-cmake)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_LIBCXX AND USE_INTERNAL_LIBCXX_LIBRARY)
|
|
||||||
add_subdirectory(libcxx-cmake)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_INTERNAL_LIBGSASL_LIBRARY)
|
if (USE_INTERNAL_LIBGSASL_LIBRARY)
|
||||||
add_subdirectory(libgsasl)
|
add_subdirectory(libgsasl)
|
||||||
endif()
|
endif()
|
||||||
|
@ -46,6 +46,6 @@ ${LIBCXX_SOURCE_DIR}/src/random.cpp
|
|||||||
add_library(cxx_static ${SRCS})
|
add_library(cxx_static ${SRCS})
|
||||||
|
|
||||||
target_include_directories(cxx_static PUBLIC ${LIBCXX_SOURCE_DIR}/include)
|
target_include_directories(cxx_static PUBLIC ${LIBCXX_SOURCE_DIR}/include)
|
||||||
target_compile_definitions(cxx_static PRIVATE -D_LIBCPP_BUILDING_LIBRARY)
|
target_compile_definitions(cxx_static PRIVATE -D_LIBCPP_BUILDING_LIBRARY -DLIBCXX_BUILDING_LIBCXXABI)
|
||||||
target_compile_options(cxx_static PRIVATE -nostdinc++)
|
target_compile_options(cxx_static PRIVATE -nostdinc++)
|
||||||
|
|
||||||
|
32
contrib/libunwind-cmake/CMakeLists.txt
Normal file
32
contrib/libunwind-cmake/CMakeLists.txt
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
set(LIBUNWIND_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libunwind)
|
||||||
|
|
||||||
|
set(LIBUNWIND_CXX_SOURCES
|
||||||
|
${LIBUNWIND_SOURCE_DIR}/src/libunwind.cpp
|
||||||
|
${LIBUNWIND_SOURCE_DIR}/src/Unwind-EHABI.cpp
|
||||||
|
${LIBUNWIND_SOURCE_DIR}/src/Unwind-seh.cpp)
|
||||||
|
if (APPLE)
|
||||||
|
set(LIBUNWIND_CXX_SOURCES ${LIBUNWIND_CXX_SOURCES} ${LIBUNWIND_SOURCE_DIR}/src/Unwind_AppleExtras.cpp)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(LIBUNWIND_C_SOURCES
|
||||||
|
${LIBUNWIND_SOURCE_DIR}/src/UnwindLevel1.c
|
||||||
|
${LIBUNWIND_SOURCE_DIR}/src/UnwindLevel1-gcc-ext.c
|
||||||
|
${LIBUNWIND_SOURCE_DIR}/src/Unwind-sjlj.c)
|
||||||
|
set_source_files_properties(${LIBUNWIND_C_SOURCES} PROPERTIES COMPILE_FLAGS "-std=c99")
|
||||||
|
|
||||||
|
set(LIBUNWIND_ASM_SOURCES
|
||||||
|
${LIBUNWIND_SOURCE_DIR}/src/UnwindRegistersRestore.S
|
||||||
|
${LIBUNWIND_SOURCE_DIR}/src/UnwindRegistersSave.S)
|
||||||
|
set_source_files_properties(${LIBUNWIND_ASM_SOURCES} PROPERTIES LANGUAGE C)
|
||||||
|
|
||||||
|
set(LIBUNWIND_SOURCES
|
||||||
|
${LIBUNWIND_CXX_SOURCES}
|
||||||
|
${LIBUNWIND_C_SOURCES}
|
||||||
|
${LIBUNWIND_ASM_SOURCES})
|
||||||
|
|
||||||
|
add_library(unwind_static ${LIBUNWIND_SOURCES})
|
||||||
|
|
||||||
|
target_include_directories(unwind_static PUBLIC ${LIBUNWIND_SOURCE_DIR}/include)
|
||||||
|
target_compile_definitions(unwind_static PRIVATE -D_LIBUNWIND_NO_HEAP=1)
|
||||||
|
target_compile_options(unwind_static PRIVATE -fno-rtti -fno-sanitize=all)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user