diff options
author | Daniel Hahler <git@thequod.de> | 2019-07-05 12:19:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-05 12:19:13 +0200 |
commit | 0d82aaf5866b954ab0fe4831df499a4713eeae35 (patch) | |
tree | 1ebc0a63cf61d50caef9f3ad8995fb7a4fb3a428 | |
parent | 7836925c3bf87f57f4b90139f5dba0570b996dc9 (diff) | |
download | rneovim-0d82aaf5866b954ab0fe4831df499a4713eeae35.tar.gz rneovim-0d82aaf5866b954ab0fe4831df499a4713eeae35.tar.bz2 rneovim-0d82aaf5866b954ab0fe4831df499a4713eeae35.zip |
build: FindLibIntl: fix warning about CMP0075 (#10427)
* build: FindLibIntl: fix warning about CMP0075
The common pattern elsewhere to set this only during the check, and here
it was not unset, resulting in a warning later (on Alpine 3.10):
-- Found Iconv
-- Looking for pthread.h
CMake Warning (dev) at /usr/share/cmake/Modules/CheckIncludeFile.cmake:80 (message):
Policy CMP0075 is not set: Include file check macros honor
CMAKE_REQUIRED_LIBRARIES. Run "cmake --help-policy CMP0075" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
CMAKE_REQUIRED_LIBRARIES is set to:
/usr/lib/libintl.so
For compatibility with CMake 3.11 and below this check is ignoring it.
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindThreads.cmake:105 (CHECK_INCLUDE_FILE)
CMakeLists.txt:482 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Looking for pthread.h - found
* build: remove lists / REMOVE_ITEM around check_c_source_compiles
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | cmake/FindLibIntl.cmake | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2900de9b7c..af526ed72d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,7 +411,7 @@ main(void) return MSGPACK_OBJECT_FLOAT32; } " MSGPACK_HAS_FLOAT32) -unset(CMAKE_REQUIRED_LIBRARIES) +list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}") if(MSGPACK_HAS_FLOAT32) add_definitions(-DNVIM_MSGPACK_HAS_FLOAT32) endif() @@ -433,8 +433,8 @@ if(FEAT_TUI) return unibi_num_from_var(unibi_var_from_num(0)); } " UNIBI_HAS_VAR_FROM) - unset(CMAKE_REQUIRED_INCLUDES) - unset(CMAKE_REQUIRED_LIBRARIES) + list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}") + list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}") if(UNIBI_HAS_VAR_FROM) add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM) endif() diff --git a/cmake/FindLibIntl.cmake b/cmake/FindLibIntl.cmake index 989cb07488..5663098147 100644 --- a/cmake/FindLibIntl.cmake +++ b/cmake/FindLibIntl.cmake @@ -31,15 +31,13 @@ find_library(LibIntl_LIBRARY ) if (LibIntl_INCLUDE_DIR) - set(CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}") + list(APPEND CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}") endif() - # On some systems (linux+glibc) libintl is passively available. # So only specify the library if one was found. if (LibIntl_LIBRARY) - set(CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}") endif() - check_c_source_compiles(" #include <libintl.h> @@ -50,6 +48,12 @@ int main(int argc, char** argv) { bind_textdomain_codeset(\"foo\", \"bar\"); textdomain(\"foo\"); }" HAVE_WORKING_LIBINTL) +if (LibIntl_INCLUDE_DIR) + list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}") +endif() +if (LibIntl_LIBRARY) + list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}") +endif() if (HAVE_WORKING_LIBINTL) # On some systems (linux+glibc) libintl is passively available. |