diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-01-17 14:31:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-01-18 17:23:23 (GMT) |
commit | 6cee4c6a8b83487af3144446ca156476a941c155 (patch) | |
tree | 124b05dfacbd39ba5a8b1c0e23b3837f619e9073 /Source | |
parent | 19ff734e76a35d59eb0f973197cadb1c271c766c (diff) | |
download | CMake-6cee4c6a8b83487af3144446ca156476a941c155.zip CMake-6cee4c6a8b83487af3144446ca156476a941c155.tar.gz CMake-6cee4c6a8b83487af3144446ca156476a941c155.tar.bz2 |
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.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Checks/cm_cxx_features.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 663d89a..7917d41 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -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() |