Skip to content

Commit

Permalink
fix: declare deps for ccomp detection
Browse files Browse the repository at this point in the history
This ensures that c++ compiler can be detected even with an explicit
`--sandbox`.

Fixes ocaml#6415

Signed-off-by: Etienne Millon <me@emillon.org>
  • Loading branch information
emillon committed Nov 30, 2022
1 parent 7ee7f95 commit a22e15e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dune_rules/cxx_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let rules ~sctx ~dir =
[ (match Ocaml_config.ccomp_type ocfg with
| Msvc -> A "/EP"
| Other _ -> As [ "-E"; "-P" ])
; A Path.(to_absolute_filename (build header_file))
; Path (Path.build header_file)
]
in
let action =
Expand Down
8 changes: 4 additions & 4 deletions test/blackbox-tests/test-cases/cxx-flags.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ With use_standard_c_and_cxx_flags = true
(this also works with sandbox=symlink, #6415)

$ dune exec --sandbox symlink ./main.exe
File ".dune/ccomp/_unknown_", line 1, characters 0-0:
cc1: fatal error: $TESTCASE_ROOT/_build/default/.dune/ccomp/header_check.h: No such file or directory
compilation terminated.
[1]
2046
4096
Hello World Baz!
Hello World Bazexe!

ccomp is not computed if not required
=====================================
Expand Down

0 comments on commit a22e15e

Please sign in to comment.