Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mac build #41

Merged
merged 6 commits into from Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,3 +8,4 @@ titandb_stress
build/
.idea/
.vscode/
cmake-build-debug/
37 changes: 28 additions & 9 deletions .travis.yml
Expand Up @@ -4,6 +4,9 @@ language: cpp

os:
- linux
- osx
compiler: clang
osx_image: xcode10.2

addons:
apt:
Expand All @@ -16,21 +19,37 @@ addons:
- lcov
- clang-format-7

env:
- BUILD_TYPE="Release"
- SANITIZER="ASAN"
- SANITIZER="TSAN"
- SANITIZER="UBSAN"

# For GCC build, we also report code coverage to codecov.
matrix:
include:
- compiler: clang
env: BUILD_TYPE="Release"
- compiler: clang
env: SANITIZER="ASAN"
- compiler: clang
exclude:
- os: osx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not running any sanitizer build for Mac build then.

env: SANITIZER="TSAN"
- compiler: clang
- os: osx
env: SANITIZER="UBSAN"
- env: COMPILER=gcc7
- env: FORMATTER=ON
- os: osx
env: BUILD_TYPE="Release"
include:
- os: linux
compiler:
env:
- COMPILER=gcc7
- os: linux
compiler:
env:
- FORMATTER=ON


install:
# osx dependencies
- if [ "${TRAVIS_OS_NAME}" == osx ]; then
brew install gflags zstd lz4 snappy xz;
fi
- git clone --depth=1 --branch=tikv-3.0 https://github.com/pingcap/rocksdb.git
- export CTEST_OUTPUT_ON_FAILURE=1
- if [ "${COMPILER}" == gcc7 ]; then
Expand Down
12 changes: 9 additions & 3 deletions CMakeLists.txt
Expand Up @@ -57,7 +57,11 @@ endif()
if (WITH_TITAN_TESTS OR WITH_TITAN_TOOLS)
add_subdirectory(${ROCKSDB_DIR} rocksdb EXCLUDE_FROM_ALL)
# -latomic is needed when building titandb_stress using clang.
link_libraries(atomic)
# check if libatomic exist before link
find_library(HAS_ATOMIC NAMES atomic libatomic.so.1 atomic.so.1)
if (HAS_ATOMIC)
link_libraries(atomic)
endif()
endif()

if (WITH_TITAN_TESTS AND (NOT CMAKE_BUILD_TYPE STREQUAL "Release"))
Expand Down Expand Up @@ -98,8 +102,10 @@ if (WITH_TITAN_TOOLS)
else()
# Hack: On Travis (with Ubuntu xenial or before), libgflags-dev package doesn't come with
# gflags-config.cmake, so find_package will fail. Hard-code gflag path for now.
set(gflags_INCLUDE_DIR "/usr/include/gflags")
list(APPEND TOOLS_LIBS "/usr/lib/x86_64-linux-gnu/libgflags.a")
if (NOT APPLE)
set(gflags_INCLUDE_DIR "/usr/include/gflags")
list(APPEND TOOLS_LIBS "/usr/lib/x86_64-linux-gnu/libgflags.a")
endif()
endif()
add_definitions(-DGFLAGS)

Expand Down