bytedance / terarkdb

A RocksDB compatible KV storage engine with better performance
Apache License 2.0
2.05k stars 202 forks source link

Update CMakeLists and fix build error #241

Closed LimingFang closed 1 year ago

LimingFang commented 2 years ago

224

LimingFang commented 2 years ago

-march=native isn't supported on Apple Silicon until llvm@15 if we use clang++.

LimingFang commented 2 years ago
#old CMakeLists.txt
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
  add_definitions(-DOS_MACOSX)
  if(CMAKE_SYSTEM_PROCESSOR MATCHES arm)
    add_definitions(-DIOS_CROSS_COMPILE -DROCKSDB_LITE)
    # no debug info for IOS, that will make our library big
    add_definitions(-DNDEBUG)

If CMAKE_SYSTEM_NAME matches "Darwin", the platforms is either x86_64 OSX or arm64 OSX rather than iOS. So when we cmake on apple-m1, we would get a lite version of RocksDB rather then a non-lite RocksDB. Here is a list of CMAKE_SYSTEM_NAME.

LimingFang commented 2 years ago

@yapple PTAL😬