summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-03-07 13:31:25 -0500
committerBrad King <brad.king@kitware.com>2016-03-07 13:52:38 -0500
commit72e0dc58d3caf63a57975e97ce13c5dc4b38cf9b (patch)
treec4011b95d6067e77f6074026d4ad9d5b381eee5b /Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake
parent8256d021c8324779c7269658a094848ebeafb82e (diff)
downloadcmake-72e0dc58d3caf63a57975e97ce13c5dc4b38cf9b.tar.gz
Diagnose recursive project/enable_language without crashing (#15999)
Calling `project()` or `enable_language()` from a toolchain file will infinitely recurse since those commands load the toolchain file. Diagnose and reject this case with an error message instead of crashing when the stack eventually overflows.
Diffstat (limited to 'Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake')
-rw-r--r--Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake
new file mode 100644
index 0000000000..b113c132a8
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake
@@ -0,0 +1 @@
+project(Bad NONE)