summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-27 13:53:46 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-03-27 13:53:53 (GMT)
commit2deb22e160bafaad40c9bc5e27b14b2723dc1bfd (patch)
tree9292883d6c603978ae4a2b0c03e26578b02294d6 /Tests
parentc0d50bf83f88c58d207b1973a84b9f88df7af3c3 (diff)
parent4d23636694f88c5a34926bae1f26d90a229d6773 (diff)
downloadCMake-2deb22e160bafaad40c9bc5e27b14b2723dc1bfd.zip
CMake-2deb22e160bafaad40c9bc5e27b14b2723dc1bfd.tar.gz
CMake-2deb22e160bafaad40c9bc5e27b14b2723dc1bfd.tar.bz2
Merge topic 'crosscompiling-warn-reset'
4d23636694 Warn if CMAKE_CROSSCOMPILING is true without CMAKE_SYSTEM_NAME set Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8358
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/ToolchainFile/SetCrossCompiling-stderr.txt8
-rw-r--r--Tests/RunCMake/ToolchainFile/SetCrossCompiling-toolchain.cmake1
-rw-r--r--Tests/RunCMake/ToolchainFile/SetCrossCompiling.cmake0
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