diff --git a/cmake/find/fastops.cmake b/cmake/find/fastops.cmake index 08a977c240b..61d1bd9f4e7 100644 --- a/cmake/find/fastops.cmake +++ b/cmake/find/fastops.cmake @@ -2,7 +2,7 @@ if (NOT ARCH_ARM AND NOT OS_FREEBSD) option (ENABLE_FASTOPS "Enable fast vectorized mathematical functions library by Mikhail Parakhin" ${NOT_UNBUNDLED}) endif () -if (ENABLE_FASTOPS) +if (ENABLE_FASTOPS AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/fastops/fastops/fastops.h") message(FATAL_ERROR "submodule contrib/fastops is missing. to fix try run: \n git submodule update --init --recursive") set(USE_FASTOPS 0) diff --git a/cmake/find/icu.cmake b/cmake/find/icu.cmake index d83a7ba4cb4..5be862f478a 100644 --- a/cmake/find/icu.cmake +++ b/cmake/find/icu.cmake @@ -1,6 +1,6 @@ option(ENABLE_ICU "Enable ICU" ON) -if(ENABLE_ICU) +if(ENABLE_ICU AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") if (APPLE) set(ICU_ROOT "/usr/local/opt/icu4c" CACHE STRING "") endif() diff --git a/cmake/find/parquet.cmake b/cmake/find/parquet.cmake index 77ce38b255e..79be144a7a4 100644 --- a/cmake/find/parquet.cmake +++ b/cmake/find/parquet.cmake @@ -1,6 +1,6 @@ option (ENABLE_PARQUET "Enable parquet" ON) -if (ENABLE_PARQUET) +if (ENABLE_PARQUET AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") if (NOT OS_FREEBSD AND NOT APPLE) # Freebsd: ../contrib/arrow/cpp/src/arrow/util/bit-util.h:27:10: fatal error: endian.h: No such file or directory option(USE_INTERNAL_PARQUET_LIBRARY "Set to FALSE to use system parquet library instead of bundled" ${NOT_UNBUNDLED}) diff --git a/cmake/find/protobuf.cmake b/cmake/find/protobuf.cmake index 57d546392c1..fe990cfe3c8 100644 --- a/cmake/find/protobuf.cmake +++ b/cmake/find/protobuf.cmake @@ -1,6 +1,6 @@ option (ENABLE_PROTOBUF "Enable protobuf" ON) -if (ENABLE_PROTOBUF) +if (ENABLE_PROTOBUF AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") option(USE_INTERNAL_PROTOBUF_LIBRARY "Set to FALSE to use system protobuf instead of bundled" ${NOT_UNBUNDLED}) diff --git a/cmake/find/readline_edit.cmake b/cmake/find/readline_edit.cmake index c2bba6cbfab..02e80a22fb1 100644 --- a/cmake/find/readline_edit.cmake +++ b/cmake/find/readline_edit.cmake @@ -2,7 +2,7 @@ include (CMakePushCheckState) cmake_push_check_state () option (ENABLE_READLINE "Enable readline" 1) -if (ENABLE_READLINE) +if (ENABLE_READLINE AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") set (READLINE_PATHS "/usr/local/opt/readline/lib") # First try find custom lib for macos users (default lib without history support) diff --git a/cmake/find/snappy.cmake b/cmake/find/snappy.cmake index a39139ee363..3287ebee68e 100644 --- a/cmake/find/snappy.cmake +++ b/cmake/find/snappy.cmake @@ -1,6 +1,6 @@ option(USE_SNAPPY "Enable support of snappy library" ON) -if (USE_SNAPPY) +if (USE_SNAPPY AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") option (USE_INTERNAL_SNAPPY_LIBRARY "Set to FALSE to use system snappy library instead of bundled" ${NOT_UNBUNDLED}) if(NOT USE_INTERNAL_SNAPPY_LIBRARY) diff --git a/cmake/find/ssl.cmake b/cmake/find/ssl.cmake index 58027276c5c..29fa1b9286e 100644 --- a/cmake/find/ssl.cmake +++ b/cmake/find/ssl.cmake @@ -1,6 +1,6 @@ option (ENABLE_SSL "Enable ssl" ON) -if (ENABLE_SSL) +if (ENABLE_SSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT ARCH_32) option(USE_INTERNAL_SSL_LIBRARY "Set to FALSE to use system *ssl library instead of bundled" ${NOT_UNBUNDLED}) diff --git a/cmake/target.cmake b/cmake/target.cmake index 51b268b7a04..2d3309ec189 100644 --- a/cmake/target.cmake +++ b/cmake/target.cmake @@ -65,14 +65,19 @@ if (CMAKE_CROSSCOMPILING) set (HAS_POST_2038_EXITCODE "0" CACHE STRING "Result from TRY_RUN" FORCE) set (HAS_POST_2038_EXITCODE__TRYRUN_OUTPUT "" CACHE STRING "Output from TRY_RUN" FORCE) + # CMake < 3.13 doesn't respect same-name variables as values for options. # FIXME: broken dependencies - set (USE_SNAPPY OFF) - set (ENABLE_SSL OFF) - set (ENABLE_PROTOBUF OFF) - set (ENABLE_PARQUET OFF) - set (ENABLE_READLINE OFF) - set (ENABLE_ICU OFF) - set (ENABLE_FASTOPS OFF) + # set (USE_SNAPPY OFF) + # set (ENABLE_SSL OFF) + # set (ENABLE_PROTOBUF OFF) + # set (ENABLE_PARQUET OFF) + # set (ENABLE_READLINE OFF) + # set (ENABLE_ICU OFF) + # set (ENABLE_FASTOPS OFF) + + message (STATUS "Cross-compiling for Darwin") + else () + message (FATAL_ERROR "Trying to cross-compile to unsupported target: ${CMAKE_SYSTEM_NAME}!") endif () # Don't know why but CXX_STANDARD doesn't work for cross-compilation diff --git a/contrib/libcxx-cmake/CMakeLists.txt b/contrib/libcxx-cmake/CMakeLists.txt index 54bbb5882e9..82d11e3e32d 100644 --- a/contrib/libcxx-cmake/CMakeLists.txt +++ b/contrib/libcxx-cmake/CMakeLists.txt @@ -44,7 +44,7 @@ target_include_directories(cxx SYSTEM BEFORE PUBLIC $