Merge topic 'CMake-cross-compiling' into release-3.19

6cee4c6a8b Restore support for cross-compiling CMake itself

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5713
This commit is contained in:
Brad King
2021-01-19 14:06:46 +00:00
committed by Kitware Robot
+7 -1
View File
@@ -81,7 +81,13 @@ if(CMake_HAVE_CXX_MAKE_UNIQUE)
endif()
cm_check_cxx_feature(unique_ptr)
if (NOT CMAKE_CXX_STANDARD LESS "17")
cm_check_cxx_feature(filesystem TRY_RUN)
if (NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR)
cm_check_cxx_feature(filesystem TRY_RUN)
else()
# In cross-compiling mode, it is not possible to check implementation bugs
# so rely only on conformance done by compilation
cm_check_cxx_feature(filesystem)
endif()
else()
set(CMake_HAVE_CXX_FILESYSTEM FALSE)
endif()