Skip to content

Commit

Permalink
Fix cmake build on Mac and add Mac Github Action runner (milvus-io#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyxu committed Jul 13, 2022
1 parent ed93f4f commit 2954cf9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,20 @@ jobs:
- name: Build
run: make -C build -j
- name: Test
run: make -C build test
run: make -C build test
mac-build:
runs-on: macos-12
timeout-minutes: 30
defaults:
run:
working-directory: ./cpp
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: brew install apache-arrow protobuf
- name: Cmake
run: cmake -B build
- name: Build
run: make -C build -j
- name: Test
run: make -C build test
12 changes: 8 additions & 4 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,18 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND CMAKE_MODULE_PATH /usr/lib/x86_64-linux-gnu/cmake/arrow)
endif ()

find_package(Arrow REQUIRED)

if (APPLE)
set(OPENSSL_ROOT_DIR /opt/homebrew/opt/openssl@1.1/)
execute_process(COMMAND brew --prefix openssl@1.1 OUTPUT_VARIABLE OPENSSL_PREFIX)
string(STRIP ${OPENSSL_PREFIX} OPENSSL_ROOT_DIR)
find_package(Zstd REQUIRED)
list(APPEND CMAKE_MODULE_PATH /opt/homebrew/opt/apache-arrow/lib/cmake/arrow)
list(APPEND CMAKE_MODULE_PATH
/opt/homebrew/opt/apache-arrow/lib/cmake/arrow
/usr/local/opt/apache-arrow/lib/cmake/arrow)
message("FOUND OPENSSL is : ${OPENSSL_ROOT_DIR}]")
endif (APPLE)

find_package(Arrow REQUIRED)

find_package(ArrowDataset REQUIRED)
include_directories(include)
include_directories(src)
Expand Down
2 changes: 1 addition & 1 deletion cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ A recent C++ compiler that supports C++20 is needed. The toolchain that has been

```sh
# On macOS 12+
brew install apache-arrow cmake protobuf
brew install apache-arrow cmake protobuf openssl@1.1
# Optionally, build document
brew install doxygen
```
Expand Down

0 comments on commit 2954cf9

Please sign in to comment.