1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-01 11:26:53 +03:00

cmake: streamline invocation

Stop specifiying the current directory.
Simplify build instructions.

Closes #1138
This commit is contained in:
Viktor Szakats
2023-07-26 22:32:00 +00:00
parent c515eed398
commit f58f77b5c8
3 changed files with 15 additions and 9 deletions

View File

@ -90,7 +90,7 @@ jobs:
curl -L https://github.com/Mbed-TLS/mbedtls/archive/$MBEDTLSVER.tar.gz | tar -xzf -
cd mbedtls-$MBEDTLSVER
[ '${{ matrix.arch }}' = 'i386' ] && crossoptions='-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DCMAKE_C_FLAGS=-m32'
cmake . ${crossoptions} \
cmake ${crossoptions} \
-DUSE_SHARED_MBEDTLS_LIBRARY=ON \
-DCMAKE_INSTALL_PREFIX:PATH=../usr
make -j3 install
@ -126,7 +126,7 @@ jobs:
if: ${{ matrix.build == 'cmake' }}
run: |
[ '${{ matrix.arch }}' = 'i386' ] && crossoptions='-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DCMAKE_C_FLAGS=-m32'
cmake . -B bld ${crossoptions} $TOOLCHAIN_OPTION \
cmake -B bld ${crossoptions} $TOOLCHAIN_OPTION \
-DENABLE_WERROR=ON \
-DCRYPTO_BACKEND=${{ matrix.crypto }} \
-DENABLE_ZLIB_COMPRESSION=${{ matrix.zlib }}
@ -202,7 +202,7 @@ jobs:
else
options='-DCMAKE_C_COMPILER=gcc'
fi
cmake . -B bld ${options} \
cmake -B bld ${options} \
-DENABLE_WERROR=ON \
-DENABLE_DEBUG_LOGGING=ON \
-DCRYPTO_BACKEND=OpenSSL \
@ -256,7 +256,7 @@ jobs:
else
system='Windows'
fi
cmake . -B bld ${options} \
cmake -B bld ${options} \
-DCMAKE_SYSTEM_NAME=${system} \
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_GENERATOR_PLATFORM=${archgen} \
@ -337,7 +337,7 @@ jobs:
- name: 'cmake configure'
if: ${{ matrix.build == 'cmake' }}
run: |
cmake . -B bld ${{ matrix.crypto.cmake }} \
cmake -B bld ${{ matrix.crypto.cmake }} \
-DCMAKE_UNITY_BUILD=ON \
-DENABLE_WERROR=ON \
-DENABLE_DEBUG_LOGGING=ON \

View File

@ -173,7 +173,7 @@ build_script:
# FIXME: First sshd test sometimes timeouts, subsequent ones almost always fail:
# 'libssh2_session_handshake failed (-43): Failed getting banner'
- echo cmake "-G%GENERATOR%" %CMAKE_ARG% -DENABLE_WERROR=ON -DCRYPTO_BACKEND=%CRYPTO_BACKEND% -DRUN_SSHD_TESTS=OFF
- cmake . -B _builds "-G%GENERATOR%" %CMAKE_ARG% -DENABLE_WERROR=ON -DCRYPTO_BACKEND=%CRYPTO_BACKEND% -DRUN_SSHD_TESTS=OFF
- cmake -B _builds "-G%GENERATOR%" %CMAKE_ARG% -DENABLE_WERROR=ON -DCRYPTO_BACKEND=%CRYPTO_BACKEND% -DRUN_SSHD_TESTS=OFF
- cmake --build _builds --config "%CONFIGURATION%"
test_script:

View File

@ -22,8 +22,14 @@ If you are happy with the default options, make a new build directory,
change to it, configure the build environment and build the project:
```
mkdir bin
cd bin
cmake -B bld
cmake --build bld
```
Use this with CMake 3.12.x or older:
```
mkdir bld
cd bld
cmake ..
cmake --build .
```