diff options
author | Martin Storsjö <martin@martin.st> | 2023-03-24 08:59:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-24 15:57:01 (GMT) |
commit | 4d23636694f88c5a34926bae1f26d90a229d6773 (patch) | |
tree | 010c25890751bc29df782805a5ae127299f61e79 /Tests | |
parent | c4c4ca0e87a900bf077b05b79b9a2198ec7493d6 (diff) | |
download | CMake-4d23636694f88c5a34926bae1f26d90a229d6773.zip CMake-4d23636694f88c5a34926bae1f26d90a229d6773.tar.gz CMake-4d23636694f88c5a34926bae1f26d90a229d6773.tar.bz2 |
Warn if CMAKE_CROSSCOMPILING is true without CMAKE_SYSTEM_NAME set
Also clarify the `CMAKE_CROSSCOMPILING` documentation to state that
CMake sets the variable automatically.
Diffstat (limited to 'Tests')
4 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake index 7744ee8..b588ce0 100644 --- a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake +++ b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake @@ -14,6 +14,7 @@ run_cmake_toolchain(LinkFlagsInit) run_cmake_toolchain(CMP0126-NEW) run_cmake_toolchain(CMP0126-OLD) run_cmake_toolchain(CMP0126-WARN) +run_cmake_toolchain(SetCrossCompiling) function(run_IncludeDirectories) run_cmake_toolchain(IncludeDirectories) diff --git a/Tests/RunCMake/ToolchainFile/SetCrossCompiling-stderr.txt b/Tests/RunCMake/ToolchainFile/SetCrossCompiling-stderr.txt new file mode 100644 index 0000000..6642cf6 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/SetCrossCompiling-stderr.txt @@ -0,0 +1,8 @@ +^CMake Warning \(dev\) at [^ +]*/Modules/CMakeDetermineSystem.cmake:[0-9]+ \(message\): + CMAKE_CROSSCOMPILING has been set by the project, toolchain file, or user\. + CMake is resetting it to false because CMAKE_SYSTEM_NAME was not set\. To + indicate cross compilation, only CMAKE_SYSTEM_NAME needs to be set\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(project\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/ToolchainFile/SetCrossCompiling-toolchain.cmake b/Tests/RunCMake/ToolchainFile/SetCrossCompiling-toolchain.cmake new file mode 100644 index 0000000..170e26c --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/SetCrossCompiling-toolchain.cmake @@ -0,0 +1 @@ +set(CMAKE_CROSSCOMPILING TRUE) diff --git a/Tests/RunCMake/ToolchainFile/SetCrossCompiling.cmake b/Tests/RunCMake/ToolchainFile/SetCrossCompiling.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/SetCrossCompiling.cmake |