1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-12-03 13:31:12 +03:00
Viktor Szakats 4997f921ee cmake: fix ENABLE_WERROR=ON breaking auto-detections
- cmake: fix compiler warnings in `CheckNonblockingSocketSupport`.
  detection functions.

  Without this, these detections fail when `ENABLE_WERROR=ON`.

- cmake: disable ENABLE_WERROR for MSVC during symbol checks in `src`.

  CMake's built-in symbol check function `check_symbol_exists()`
  generate warnings with MSVC. With warnings considered errors, these
  detections fail permanently. Our workaround is to disable
  warnings-as-errors while running these checks.

  ```
  CheckSymbolExists.c(8): warning C4054: 'type cast': from function pointer '__int64 (__cdecl *)(const char *,char **,int)' to data pointer 'int *'
  in `return ((int*)(&strtoll))[argc];`
  ```

  Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46537222/job/4vg4yg333mu2lg9b

- example: replace `strcasecmp()` with C89 `strcmp()`.

  To avoid using CMake symbol checks in `example`.

  Another option is to duplicate the `check_symbol_exists()` workaround
  from `src`, but I figure it's not worth the complexity. We use
  `strcasecmp()` solely to check optional command-line options for
  example programs, and those are fine as lower-case.

  Without this, these detections fail when `ENABLE_WERROR=ON`.

- also delete `__function__` detection/use in `example`.

  To avoid the complexity for the sake of using it at a single place in
  of the example's error branch. Replace that use with a literal name of
  the function.

- cmake: also use `CMakePushCheckState` functions instead of manual
  save/restore.

Closes #857
2023-03-19 17:42:12 +00:00
2023-03-07 14:08:12 +00:00
2019-08-02 16:38:08 -07:00
2021-08-29 22:36:43 +02:00
2011-04-04 13:31:33 +02:00
2016-02-24 23:44:13 +01:00
2021-11-11 11:35:47 -08:00
2011-04-04 13:31:33 +02:00
2021-09-03 09:17:34 +02:00
2021-08-29 22:36:43 +02:00

libssh2 - SSH2 library

libssh2 is a library implementing the SSH2 protocol, available under the revised BSD license.

Web site

Mailing list

BSD Licensed

Web site source code

Installation instructions:

Description
libssh2 - это библиотека, реализующая протокол SSH2, доступная по пересмотренной лицензии BSD
Readme 16 MiB
Languages
C 85.1%
M4 3.6%
CMake 3.5%
Shell 2.6%
RPGLE 1.7%
Other 3.2%