Fix cmake issues detecting mongo and libsystemd on macOS (#1621)
- libsystemd does not exist on macOS - ignore it and reduce warnings during cmake step - mongo-c has cmake file on macOS - reusing the same code path and reduce warnings
This commit is contained in:
parent
58f1b8926c
commit
c98bb93514
35
.github/workflows/macos.yml
vendored
35
.github/workflows/macos.yml
vendored
@ -48,3 +48,38 @@ jobs:
|
||||
working-directory: examples/
|
||||
- run: ./run_tests_conf.sh
|
||||
working-directory: examples/
|
||||
|
||||
build-cmake:
|
||||
name: build + test cmake
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ver: ["15"]
|
||||
runs-on: macos-${{ matrix.ver }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Relink `python` package in `brew`
|
||||
# Unlink and re-link to prevent errors when GitHub `macos` runner images
|
||||
# install `python` outside of `brew`, for example:
|
||||
# https://github.com/orgs/Homebrew/discussions/3895
|
||||
# https://github.com/actions/setup-python/issues/577
|
||||
# https://github.com/actions/runner-images/issues/6459
|
||||
# https://github.com/actions/runner-images/issues/6507
|
||||
# https://github.com/actions/runner-images/issues/2322
|
||||
run: brew list -1
|
||||
| grep python
|
||||
| while read formula; do brew unlink $formula; brew link --overwrite $formula; done
|
||||
|
||||
- run: brew update
|
||||
- run: brew install wget pkg-config libevent openssl@1.1 sqlite hiredis mongo-c-driver libmicrohttpd
|
||||
|
||||
- name: Configure
|
||||
run: cmake -B ${{github.workspace}}/build
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/build
|
||||
|
||||
- run: ./run_tests.sh
|
||||
working-directory: examples/
|
||||
- run: ./run_tests_conf.sh
|
||||
working-directory: examples/
|
||||
@ -75,7 +75,7 @@ else()
|
||||
list(APPEND turnserver_DEFINED TURN_NO_MYSQL)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(WIN32 OR APPLE)
|
||||
find_package(mongoc-1.0)
|
||||
if(mongoc-1.0_FOUND)
|
||||
list(APPEND turnserver_LIBS mongo::mongoc_shared)
|
||||
@ -104,7 +104,7 @@ else()
|
||||
list(APPEND turnserver_DEFINED TURN_NO_HIREDIS)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
if(UNIX AND (NOT APPLE))
|
||||
find_package(libsystemd)
|
||||
if(NOT libsystemd_FOUND)
|
||||
list(APPEND turnserver_DEFINED TURN_NO_SYSTEMD)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user