Drop try_run macro from CMake's own build

Since commit 9199f7c627 (Disable arch-specific try_run in CMake itself,
2009-12-14, v2.8.2~567) we've abused an undocumented debugging feature
to override the builtin `try_run` command in CMake's own build with a
wrapper macro.  However, we've also long discouraged use of this feature
by other projects.  The purpose of the original change is outdated and
of limited use anyway, so just drop it.
This commit is contained in:
Brad King 2022-09-26 17:51:29 -04:00
parent eb6e2ef7f6
commit 4b2e765025

View File

@ -60,17 +60,6 @@ else()
set(USE_LGPL "")
endif()
if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# Disallow architecture-specific try_run. It may not run on the host.
macro(TRY_RUN)
if(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
message(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
else()
_TRY_RUN(${ARGV})
endif()
endmacro()
endif()
# Use most-recent available language dialects with GNU and Clang
if(NOT DEFINED CMAKE_C_STANDARD AND NOT CMake_NO_C_STANDARD)
include(${CMake_SOURCE_DIR}/Source/Checks/cm_c11_thread_local.cmake)