summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CommandLine/trycompile-clean.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CommandLine/trycompile-clean.cmake')
-rw-r--r--Tests/RunCMake/CommandLine/trycompile-clean.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/trycompile-clean.cmake b/Tests/RunCMake/CommandLine/trycompile-clean.cmake
new file mode 100644
index 0000000..11ec2b9
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trycompile-clean.cmake
@@ -0,0 +1,8 @@
+enable_language(C)
+
+# Look for a source tree left by enable_language internal checks.
+set(scratch ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeScratch)
+file(GLOB_RECURSE remnants ${scratch}/TryCompile-*/*)
+if(remnants)
+ message(FATAL_ERROR "try_compile should not leave artifacts behind")
+endif()