Commit f8af94a2 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'binutils-var-private' into release-3.20

4d786dfc

 BinUtils: Avoid clobbering a variable named without a private prefix
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !5986
parents 196376a3 4d786dfc
......@@ -123,19 +123,19 @@ else()
list(APPEND _CMAKE_TOOL_VARS AR RANLIB STRIP LINKER NM OBJDUMP OBJCOPY READELF DLLTOOL ADDR2LINE)
endif()
foreach(TOOL IN LISTS _CMAKE_TOOL_VARS)
foreach(NAME IN LISTS _CMAKE_${TOOL}_NAMES)
foreach(_tool IN LISTS _CMAKE_TOOL_VARS)
foreach(_name IN LISTS _CMAKE_${_tool}_NAMES)
if(NOT _CMAKE_TOOLCHAIN_PREFIX STREQUAL "")
if(NOT _CMAKE_TOOLCHAIN_SUFFIX STREQUAL "")
list(PREPEND _CMAKE_${TOOL}_NAMES ${NAME}${_CMAKE_TOOLCHAIN_SUFFIX})
list(PREPEND _CMAKE_${_tool}_NAMES ${_name}${_CMAKE_TOOLCHAIN_SUFFIX})
endif()
list(PREPEND _CMAKE_${TOOL}_NAMES ${_CMAKE_TOOLCHAIN_PREFIX}${NAME})
list(PREPEND _CMAKE_${_tool}_NAMES ${_CMAKE_TOOLCHAIN_PREFIX}${_name})
endif()
if(NOT _CMAKE_TOOLCHAIN_SUFFIX STREQUAL "")
list(PREPEND _CMAKE_${TOOL}_NAMES ${_CMAKE_TOOLCHAIN_PREFIX}${NAME}${_CMAKE_TOOLCHAIN_SUFFIX})
list(PREPEND _CMAKE_${_tool}_NAMES ${_CMAKE_TOOLCHAIN_PREFIX}${_name}${_CMAKE_TOOLCHAIN_SUFFIX})
endif()
endforeach()
find_program(CMAKE_${TOOL} NAMES ${_CMAKE_${TOOL}_NAMES} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_${_tool} NAMES ${_CMAKE_${_tool}_NAMES} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
endforeach()
if(NOT CMAKE_RANLIB)
......@@ -154,12 +154,12 @@ if(CMAKE_PLATFORM_HAS_INSTALLNAME)
endif()
# Mark any tool cache entries as advanced.
foreach(var IN LISTS _CMAKE_TOOL_VARS)
get_property(_CMAKE_TOOL_CACHED CACHE CMAKE_${var} PROPERTY TYPE)
foreach(_tool IN LISTS _CMAKE_TOOL_VARS)
get_property(_CMAKE_TOOL_CACHED CACHE CMAKE_${_tool} PROPERTY TYPE)
if(_CMAKE_TOOL_CACHED)
mark_as_advanced(CMAKE_${var})
mark_as_advanced(CMAKE_${_tool})
endif()
unset(_CMAKE_${var}_NAMES)
unset(_CMAKE_${_tool}_NAMES)
endforeach()
unset(_CMAKE_TOOL_VARS)
unset(_CMAKE_TOOL_CACHED)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment