From 42aeb5c5b18af1362362a2e6bdf10a2a4ec70f0f Mon Sep 17 00:00:00 2001 From: dundargoc Date: Tue, 9 Aug 2022 17:02:51 +0200 Subject: build: remove unnecessary policy related code Having cmake version 3.10 as the required minimum version ensures these are set to new by default. --- cmake/RunTests.cmake | 5 ----- 1 file changed, 5 deletions(-) (limited to 'cmake/RunTests.cmake') diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index e07c6dd174..86ce22de72 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -1,11 +1,6 @@ # Set LC_ALL to meet expectations of some locale-sensitive tests. set(ENV{LC_ALL} "en_US.UTF-8") -if(POLICY CMP0012) - # Handle CI=true, without dev warnings. - cmake_policy(SET CMP0012 NEW) -endif() - set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime) set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest) set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config) -- cgit From 600136cfb641be450900f8b7a1bfdc4fbcb69856 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Fri, 23 Sep 2022 16:16:17 +0200 Subject: revert: "build: remove unnecessary policy related code" #20289 This partially reverts commit 42aeb5c5b18af1362362a2e6bdf10a2a4ec70f0f. Setting cmake policies is normally not required as cmake_minimum_required automatically sets these. One exception is cmake script mode (-P) since it automatically resets all policy changes. Closes: https://github.com/neovim/neovim/issues/20286 --- cmake/RunTests.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmake/RunTests.cmake') diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index 86ce22de72..2abe29b54b 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -1,6 +1,13 @@ # Set LC_ALL to meet expectations of some locale-sensitive tests. set(ENV{LC_ALL} "en_US.UTF-8") +if(POLICY CMP0012) + # Avoid policy warning due to CI=true. This is needed even if the main + # project has already set this policy as policy settings are reset when using + # the cmake script mode (-P). + cmake_policy(SET CMP0012 NEW) +endif() + set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime) set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest) set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config) -- cgit