ClickHouse/cmake/target.cmake

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
2.3 KiB
CMake
Raw Normal View History

2019-08-30 16:50:43 +00:00
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set (OS_LINUX 1)
2019-09-24 00:22:05 +00:00
add_definitions(-D OS_LINUX)
2020-07-15 11:16:00 +00:00
elseif (CMAKE_SYSTEM_NAME MATCHES "Android")
# This is a toy configuration and not in CI, so expect it to be broken.
# Use cmake flags such as: -DCMAKE_TOOLCHAIN_FILE=~/ch2/android-ndk-r21d/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=28
set (OS_ANDROID 1)
add_definitions(-D OS_ANDROID)
2019-08-30 16:50:43 +00:00
elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set (OS_FREEBSD 1)
2019-09-24 00:22:05 +00:00
add_definitions(-D OS_FREEBSD)
2019-08-30 16:50:43 +00:00
elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
set (OS_DARWIN 1)
2019-09-24 00:22:05 +00:00
add_definitions(-D OS_DARWIN)
elseif (CMAKE_SYSTEM_NAME MATCHES "SunOS")
set (OS_SUNOS 1)
add_definitions(-D OS_SUNOS)
else ()
message (FATAL_ERROR "Platform ${CMAKE_SYSTEM_NAME} is not supported")
2019-08-30 16:50:43 +00:00
endif ()
if (CMAKE_CROSSCOMPILING)
if (OS_DARWIN)
# FIXME: broken dependencies
set (ENABLE_GRPC OFF CACHE INTERNAL "") # no protobuf -> no grpc
set (ENABLE_ICU OFF CACHE INTERNAL "")
set (ENABLE_FASTOPS OFF CACHE INTERNAL "")
2020-07-15 11:16:00 +00:00
elseif (OS_LINUX OR OS_ANDROID)
if (ARCH_AARCH64)
# FIXME: broken dependencies
set (ENABLE_GRPC OFF CACHE INTERNAL "")
2022-01-17 22:08:35 +00:00
set (ENABLE_SENTRY OFF CACHE INTERNAL "")
2021-10-11 22:47:34 +00:00
elseif (ARCH_PPC64LE)
set (ENABLE_GRPC OFF CACHE INTERNAL "")
2022-01-17 22:08:35 +00:00
set (ENABLE_SENTRY OFF CACHE INTERNAL "")
endif ()
elseif (OS_FREEBSD)
# FIXME: broken dependencies
2021-10-12 19:25:45 +00:00
set (ENABLE_PARQUET OFF CACHE INTERNAL "")
set (ENABLE_ORC OFF CACHE INTERNAL "")
set (ENABLE_GRPC OFF CACHE INTERNAL "")
2021-10-12 22:14:47 +00:00
set (ENABLE_EMBEDDED_COMPILER OFF CACHE INTERNAL "")
else ()
message (FATAL_ERROR "Trying to cross-compile to unsupported system: ${CMAKE_SYSTEM_NAME}!")
2019-08-30 16:50:43 +00:00
endif ()
2019-09-11 10:01:38 +00:00
2021-11-28 21:06:54 +00:00
if (USE_MUSL)
2022-01-17 22:08:35 +00:00
set (ENABLE_SENTRY OFF CACHE INTERNAL "")
2021-11-28 21:06:54 +00:00
set (ENABLE_ODBC OFF CACHE INTERNAL "")
set (ENABLE_GRPC OFF CACHE INTERNAL "")
set (ENABLE_HDFS OFF CACHE INTERNAL "")
set (ENABLE_EMBEDDED_COMPILER OFF CACHE INTERNAL "")
endif ()
2019-09-11 10:01:38 +00:00
# Don't know why but CXX_STANDARD doesn't work for cross-compilation
2021-10-11 23:07:03 +00:00
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
message (STATUS "Cross-compiling for target: ${CMAKE_CXX_COMPILE_TARGET}")
2019-08-30 16:50:43 +00:00
endif ()