summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CXXModules/NinjaForceResponseFile-check.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CXXModules/NinjaForceResponseFile-check.cmake')
-rw-r--r--Tests/RunCMake/CXXModules/NinjaForceResponseFile-check.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/Tests/RunCMake/CXXModules/NinjaForceResponseFile-check.cmake b/Tests/RunCMake/CXXModules/NinjaForceResponseFile-check.cmake
new file mode 100644
index 0000000..b8863e7
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/NinjaForceResponseFile-check.cmake
@@ -0,0 +1,23 @@
+if (RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(path "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/impl-Debug.ninja")
+else ()
+ set(path "${RunCMake_TEST_BINARY_DIR}/build.ninja")
+endif ()
+
+if (NOT EXISTS "${path}")
+ list(APPEND RunCMake_TEST_FAILED
+ "Failed to find `ninja` build file: '${path}'")
+endif ()
+
+file(READ "${path}" rspfiles
+ REGEX "^ *RSP_FILE =")
+
+if (rspfiles MATCHES "\\$out\\.rsp$")
+ message(FATAL_ERROR
+ "rspfiles for modules should be specified explicitly")
+elseif (NOT rspfiles MATCHES "ddi\\.rsp")
+ message(FATAL_ERROR
+ "rspfiles for scanning rules should be specified according to scan output filenames")
+endif ()
+
+string(REPLACE ";" "\n " RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}")