Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: suppress CMake warning about CMP0057 #2503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tchaikov
Copy link
Contributor

when building a project by consuming Seastar's CMake config files, if the parent project does not set the policy CMP0057, CMake warns:

CMake Warning (dev) at /tmp/seastar/lib64/cmake/Seastar/FindSanitizers.cmake:53 (if):
  Policy CMP0057 is not set: Support new IN_LIST if() operator.  Run "cmake
  --help-policy CMP0057" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  IN_LIST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /tmp/seastar/lib64/cmake/Seastar/SeastarDependencies.cmake:55 (find_dependency)
  /tmp/seastar/lib64/cmake/Seastar/SeastarDependencies.cmake:98 (seastar_find_dep)
  /tmp/seastar/lib64/cmake/Seastar/SeastarConfig.cmake:56 (seastar_find_dependencies)
  CMakeLists.txt:5 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /tmp/seastar/lib64/cmake/Seastar/FindSanitizers.cmake:53 (if):
  if given arguments:

    "address" "IN_LIST" "Sanitizers_FIND_COMPONENTS"

  Unknown arguments specified
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /tmp/seastar/lib64/cmake/Seastar/SeastarDependencies.cmake:55 (find_dependency)
  /tmp/seastar/lib64/cmake/Seastar/SeastarDependencies.cmake:98 (seastar_find_dep)
  /tmp/seastar/lib64/cmake/Seastar/SeastarConfig.cmake:56 (seastar_find_dependencies)
  CMakeLists.txt:5 (find_package)

it is the library's responsibility to provide a warning-free CMake module, so let's silence this warning. as we are indeed using IN_LIST as an operator in if clause.

when building a project by consuming Seastar's CMake config files,
if the parent project does not set the policy CMP0057, CMake warns:

```
CMake Warning (dev) at /tmp/seastar/lib64/cmake/Seastar/FindSanitizers.cmake:53 (if):
  Policy CMP0057 is not set: Support new IN_LIST if() operator.  Run "cmake
  --help-policy CMP0057" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  IN_LIST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /tmp/seastar/lib64/cmake/Seastar/SeastarDependencies.cmake:55 (find_dependency)
  /tmp/seastar/lib64/cmake/Seastar/SeastarDependencies.cmake:98 (seastar_find_dep)
  /tmp/seastar/lib64/cmake/Seastar/SeastarConfig.cmake:56 (seastar_find_dependencies)
  CMakeLists.txt:5 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /tmp/seastar/lib64/cmake/Seastar/FindSanitizers.cmake:53 (if):
  if given arguments:

    "address" "IN_LIST" "Sanitizers_FIND_COMPONENTS"

  Unknown arguments specified
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /tmp/seastar/lib64/cmake/Seastar/SeastarDependencies.cmake:55 (find_dependency)
  /tmp/seastar/lib64/cmake/Seastar/SeastarDependencies.cmake:98 (seastar_find_dep)
  /tmp/seastar/lib64/cmake/Seastar/SeastarConfig.cmake:56 (seastar_find_dependencies)
  CMakeLists.txt:5 (find_package)
```

it is the library's responsibility to provide a warning-free CMake
module, so let's silence this warning. as we are indeed using `IN_LIST`
as an operator in `if` clause.

Signed-off-by: Kefu Chai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant