summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeIOSInstallCombined.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2018-09-12 06:40:37 (GMT)
committerCraig Scott <craig.scott@crascit.com>2018-09-12 06:44:59 (GMT)
commite549e31f798b05345de5a36f876197b595296eb4 (patch)
tree67f33050e982530c3037faa28794c4125340e77c /Modules/CMakeIOSInstallCombined.cmake
parent344eb9c8dc3b16a524729cb66ad25fc1c127a02c (diff)
downloadCMake-e549e31f798b05345de5a36f876197b595296eb4.zip
CMake-e549e31f798b05345de5a36f876197b595296eb4.tar.gz
CMake-e549e31f798b05345de5a36f876197b595296eb4.tar.bz2
CMakeIOSInstallCombined: Prevent policy leakage
Functions do not introduce a new policy scope, so surround these policy changes with a push-pop to prevent them from affecting the caller.
Diffstat (limited to 'Modules/CMakeIOSInstallCombined.cmake')
-rw-r--r--Modules/CMakeIOSInstallCombined.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/CMakeIOSInstallCombined.cmake b/Modules/CMakeIOSInstallCombined.cmake
index fad2e8f..418bafd 100644
--- a/Modules/CMakeIOSInstallCombined.cmake
+++ b/Modules/CMakeIOSInstallCombined.cmake
@@ -1,6 +1,8 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
+cmake_policy(PUSH)
+cmake_policy(SET CMP0057 NEW) # if IN_LIST
# Function to print messages of this module
function(_ios_install_combined_message)
@@ -57,6 +59,7 @@ endfunction()
# Get architectures of given SDK (iphonesimulator/iphoneos)
function(_ios_install_combined_get_valid_archs sdk resultvar)
+ cmake_policy(PUSH)
cmake_policy(SET CMP0007 NEW)
if("${resultvar}" STREQUAL "")
@@ -73,6 +76,8 @@ function(_ios_install_combined_get_valid_archs sdk resultvar)
_ios_install_combined_message("Architectures (${sdk}): ${printable}")
set("${resultvar}" "${valid_archs}" PARENT_SCOPE)
+
+ cmake_policy(POP)
endfunction()
# Final target can contain more architectures that specified by SDK. This
@@ -161,8 +166,6 @@ function(_ios_install_combined_keep_archs lib archs)
endfunction()
function(_ios_install_combined_detect_sdks this_sdk_var corr_sdk_var)
- cmake_policy(SET CMP0057 NEW)
-
set(this_sdk "$ENV{PLATFORM_NAME}")
if("${this_sdk}" STREQUAL "")
message(FATAL_ERROR "Environment variable PLATFORM_NAME is empty")
@@ -305,3 +308,5 @@ function(ios_install_combined target destination)
_ios_install_combined_message("Install done: ${destination}")
endfunction()
+
+cmake_policy(POP)