diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2019-05-23 13:19:59 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2019-05-23 13:19:59 (GMT) |
commit | 32e4f236b7635fe5008966065ec4099ba23ecf58 (patch) | |
tree | c13dac7d7f3aca0ff6a11fb0cb45cff79197497c /Modules/Compiler/ARMClang.cmake | |
parent | a4faf7788cc40b17c48a9393cd15425ee65abfd9 (diff) | |
download | CMake-32e4f236b7635fe5008966065ec4099ba23ecf58.zip CMake-32e4f236b7635fe5008966065ec4099ba23ecf58.tar.gz CMake-32e4f236b7635fe5008966065ec4099ba23ecf58.tar.bz2 |
ARMClang: fix policy manipulation in the compiler module
Policies have their own scoping and cannot be set within a function
without affecting callers.
Diffstat (limited to 'Modules/Compiler/ARMClang.cmake')
-rw-r--r-- | Modules/Compiler/ARMClang.cmake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/Compiler/ARMClang.cmake b/Modules/Compiler/ARMClang.cmake index 5ca49df..2518ac7 100644 --- a/Modules/Compiler/ARMClang.cmake +++ b/Modules/Compiler/ARMClang.cmake @@ -3,6 +3,9 @@ if(_ARMClang_CMAKE_LOADED) endif() set(_ARMClang_CMAKE_LOADED TRUE) +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) # if IN_LIST + get_filename_component(_CMAKE_C_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH) get_filename_component(_CMAKE_CXX_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH) @@ -29,9 +32,6 @@ endfunction() # check processor is in list function(__armclang_check_processor processor list out_var) string(TOLOWER "${processor}" processor) - if(POLICY CMP0057) - cmake_policy(SET CMP0057 NEW) - endif() if(processor IN_LIST list) set(${out_var} TRUE PARENT_SCOPE) else() @@ -67,3 +67,5 @@ macro(__compiler_armclang lang) set(CMAKE_${lang}_OUTPUT_EXTENSION ".o") set(CMAKE_${lang}_OUTPUT_EXTENSION_REPLACE 1) endmacro() + +cmake_policy(POP) |