@@ -67,18 +67,19 @@ if [[ "$out_static" != "$out_dyndep" ]]; then
6767 exit 1
6868fi
6969
70- # Dyndep mode must have created the dyndep file.
71- [[ -f " ${triple}${fp_dir} /build.ninja.dd" ]] || {
72- echo " FAIL: build.ninja.dd not produced under MCPP_NINJA_DYNDEP=1"
70+ # P1 (0.0.10+): per-file dyndep — each .cppm gets its own .dd file.
71+ dd_files=$( find " ${triple}${fp_dir} " -name ' *.ddi.dd' | wc -l)
72+ [[ " $dd_files " -gt 0 ]] || {
73+ echo " FAIL: no per-file .ddi.dd files produced under MCPP_NINJA_DYNDEP=1"
7374 exit 1
7475}
7576
76- # Dyndep mode must have emitted scan rules.
77+ # Dyndep mode must have emitted scan + per-file dyndep rules.
7778grep -q ' ^rule cxx_scan' ${triple}${fp_dir} /build.ninja || {
7879 echo " FAIL: build.ninja missing cxx_scan rule" ; exit 1; }
79- grep -q ' ^rule cxx_collect ' ${triple}${fp_dir} /build.ninja || {
80- echo " FAIL: build.ninja missing cxx_collect rule" ; exit 1; }
81- grep -q ' dyndep = build.ninja.dd ' ${triple}${fp_dir} /build.ninja || {
80+ grep -q ' ^rule cxx_dyndep ' ${triple}${fp_dir} /build.ninja || {
81+ echo " FAIL: build.ninja missing cxx_dyndep rule" ; exit 1; }
82+ grep -q ' dyndep = ' ${triple}${fp_dir} /build.ninja || {
8283 echo " FAIL: compile edges missing dyndep =" ; exit 1; }
8384
8485# Static mode must NOT have those rules (sanity).
@@ -91,12 +92,11 @@ ddi=$(find target -name '*.cppm.ddi' | head -1)
9192grep -q ' "rules"' " $ddi " || { echo " FAIL: .ddi missing rules" ; exit 1; }
9293grep -q ' "primary-output"' " $ddi " || { echo " FAIL: .ddi missing primary-output" ; exit 1; }
9394
94- # build.ninja.dd content sanity.
95- ddep=" ${triple}${fp_dir} /build.ninja.dd"
95+ # Per-file .dd content sanity.
96+ ddep=$( find " ${triple}${fp_dir} " -name ' *.ddi.dd' | head -1)
97+ [[ -n " $ddep " ]] || { echo " FAIL: no .ddi.dd file" ; exit 1; }
9698grep -q ' ninja_dyndep_version = 1' " $ddep " || {
9799 echo " FAIL: dyndep file missing version header" ; exit 1; }
98- grep -q ' gcm.cache/myapp.lib-greet.gcm' " $ddep " || {
99- echo " FAIL: dyndep file missing partition BMI" ; cat " $ddep " ; exit 1; }
100100
101101# Incremental: re-run dyndep build → must be noop.
102102out2=$( MCPP_NINJA_DYNDEP=1 " $MCPP " build 2>&1 )
0 commit comments