From: Michael Wallner Date: Fri, 2 Oct 2020 21:31:46 +0000 (+0200) Subject: mac build X-Git-Tag: 1.1.0-beta1~236^2~22^2~7 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=824238e1ddeb304cdfc69ab8915ea0a028a5cf50;p=awesomized%2Flibmemcached mac build --- diff --git a/.github/workflows/cmake-build-ci.gen b/.github/workflows/cmake-build-ci.gen index b9ce97fe..3aa1e037 100755 --- a/.github/workflows/cmake-build-ci.gen +++ b/.github/workflows/cmake-build-ci.gen @@ -16,7 +16,7 @@ const DEF = [ "CXX" => "g++", ], "clang" => [ - "ver" => "", + "ver" => "apple", "CC" => "clang", "CXX" => "clang++", ], @@ -119,9 +119,20 @@ function steps_setenv($splat_map = null) { function steps_getdeps() { ?> - - name: Install dependencies + - name: Install dependencies (Linux) if: runner.os == 'Linux' - run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX} + run: | + sudo apt-get install \ + libevent-dev \ + libsasl2-dev \ + ${INSTALL_MEMCACHED} \ + ${INSTALL_CC} ${INSTALL_CXX} + sudo systemctl stop memcached || true + - name: Install dependencies (Mac) + if: runner.os == 'macOS' + run: | + brew install bison flex ${INSTALL_MEMCACHED} + brew services stop memcached || true - uses: codecov/codecov-action@v1.0.13 + # mac build + ci-mac: + name: ci-dbg (, , ) + runs-on: # + continue-on-error: true + env: + MEMCACHED_BINARY: /usr/local/bin/memcached + steps: + - uses actions/checkout@v2 + + # release builds ci-rel: strategy: diff --git a/.github/workflows/cmake-build-ci.yml b/.github/workflows/cmake-build-ci.yml index 67d1022a..fcb5a501 100644 --- a/.github/workflows/cmake-build-ci.yml +++ b/.github/workflows/cmake-build-ci.yml @@ -48,9 +48,20 @@ jobs: run: | echo CC=gcc-9 >> ${GITHUB_ENV} echo CXX=g++-9 >> ${GITHUB_ENV} - - name: Install dependencies + - name: Install dependencies (Linux) if: runner.os == 'Linux' - run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX} + run: | + sudo apt-get install \ + libevent-dev \ + libsasl2-dev \ + ${INSTALL_MEMCACHED} \ + ${INSTALL_CC} ${INSTALL_CXX} + sudo systemctl stop memcached || true + - name: Install dependencies (Mac) + if: runner.os == 'macOS' + run: | + brew install bison flex ${INSTALL_MEMCACHED} + brew services stop memcached || true - name: Build memcached run: | cd memcached @@ -90,9 +101,20 @@ jobs: run: | echo CC=gcc-9 >> ${GITHUB_ENV} echo CXX=g++-9 >> ${GITHUB_ENV} - - name: Install dependencies + - name: Install dependencies (Linux) if: runner.os == 'Linux' - run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX} + run: | + sudo apt-get install \ + libevent-dev \ + libsasl2-dev \ + ${INSTALL_MEMCACHED} \ + ${INSTALL_CC} ${INSTALL_CXX} + sudo systemctl stop memcached || true + - name: Install dependencies (Mac) + if: runner.os == 'macOS' + run: | + brew install bison flex ${INSTALL_MEMCACHED} + brew services stop memcached || true - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }}) run: cmake -S . -B build - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }} @@ -119,9 +141,20 @@ jobs: run: | echo CC=gcc-9 >> ${GITHUB_ENV} echo CXX=g++-9 >> ${GITHUB_ENV} - - name: Install dependencies + - name: Install dependencies (Linux) if: runner.os == 'Linux' - run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX} + run: | + sudo apt-get install \ + libevent-dev \ + libsasl2-dev \ + ${INSTALL_MEMCACHED} \ + ${INSTALL_CC} ${INSTALL_CXX} + sudo systemctl stop memcached || true + - name: Install dependencies (Mac) + if: runner.os == 'macOS' + run: | + brew install bison flex ${INSTALL_MEMCACHED} + brew services stop memcached || true - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }}) run: cmake -S . -B build - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }} @@ -135,6 +168,41 @@ jobs: run: cat build/Testing/Temporary/LastTest.log || true - uses: codecov/codecov-action@v1.0.13 + # mac build + ci-mac: + name: ci-dbg (macos-10.15, clang, apple) + runs-on: macos-10.15 # + continue-on-error: true + env: + MEMCACHED_BINARY: /usr/local/bin/memcached + steps: + - uses actions/checkout@v2 + - name: Install dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get install \ + libevent-dev \ + libsasl2-dev \ + ${INSTALL_MEMCACHED} \ + ${INSTALL_CC} ${INSTALL_CXX} + sudo systemctl stop memcached || true + - name: Install dependencies (Mac) + if: runner.os == 'macOS' + run: | + brew install bison flex ${INSTALL_MEMCACHED} + brew services stop memcached || true + - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }}) + run: cmake -S . -B build + - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }} + run: make -C build -j2 all + - name: Test + run: make -C build -j2 test + - name: Install + run: make -C build -j2 install DESTDIR=. + - name: Failed tests log + if: ${{ failure() }} + run: cat build/Testing/Temporary/LastTest.log || true + # release builds ci-rel: strategy: @@ -217,9 +285,20 @@ jobs: echo CXX=clang++-7 >> ${GITHUB_ENV} echo INSTALL_CC='clang-7' >> ${GITHUB_ENV} echo INSTALL_CXX='clang-7' >> ${GITHUB_ENV} - - name: Install dependencies + - name: Install dependencies (Linux) if: runner.os == 'Linux' - run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX} + run: | + sudo apt-get install \ + libevent-dev \ + libsasl2-dev \ + ${INSTALL_MEMCACHED} \ + ${INSTALL_CC} ${INSTALL_CXX} + sudo systemctl stop memcached || true + - name: Install dependencies (Mac) + if: runner.os == 'macOS' + run: | + brew install bison flex ${INSTALL_MEMCACHED} + brew services stop memcached || true - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }}) run: cmake -S . -B build - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }} diff --git a/CMake/CheckDependency.cmake b/CMake/CheckDependency.cmake index 3cb57535..edcaea4d 100644 --- a/CMake/CheckDependency.cmake +++ b/CMake/CheckDependency.cmake @@ -3,6 +3,7 @@ find_package(PkgConfig) include(SafeString) include(CheckHeader) + function(check_dependency NAME LIB HEADER) if(PKG_CONFIG_FOUND) pkg_check_modules(${NAME} lib${LIB}${ARGN})