mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
Restore support for cross-compiling CMake itself
In commit eb583b0a66 (cmake_path command: path management, 2020-07-23,
v3.19.0-rc1~216^2~1) we added a `try_run`. In cross-compilation mode,
C++ features tests must avoid running tests if there is no emulator
defined.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user