Skip to content

Commit

Permalink
Merge pull request #2036 from rgrinberg/fix-2033
Browse files Browse the repository at this point in the history
Allow . in c_names and cxx_names
  • Loading branch information
rgrinberg authored Apr 9, 2019
2 parents 94fc4ed + 6652739 commit d300cde
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ unreleased
`binaries` fields would be ignored, but instead they should be combined.
(#2029, @rgrinberg)

- Allow "." in `c_names` and `cxx_names` (#2036, fix #2033, @rgrinberg)

1.8.2 (10/03/2019)
------------------

Expand Down
2 changes: 1 addition & 1 deletion src/c.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Kind = struct
| Recognized of string * t

let split_extension fn ~dune_version =
match String.lsplit2 fn ~on:'.' with
match String.rsplit2 fn ~on:'.' with
| Some (obj, "c") -> Recognized (obj, C)
| Some (obj, "cpp") -> Recognized (obj, Cxx)
| Some (obj, "cxx") ->
Expand Down
10 changes: 10 additions & 0 deletions test/blackbox-tests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,14 @@
test-cases/github20
(progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))

(alias
(name github2033)
(deps (package dune) (source_tree test-cases/github2033))
(action
(chdir
test-cases/github2033
(progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))

(alias
(name github24)
(deps (package dune) (source_tree test-cases/github24))
Expand Down Expand Up @@ -1443,6 +1451,7 @@
(alias github1856)
(alias github1946)
(alias github20)
(alias github2033)
(alias github24)
(alias github25)
(alias github534)
Expand Down Expand Up @@ -1606,6 +1615,7 @@
(alias github1856)
(alias github1946)
(alias github20)
(alias github2033)
(alias github24)
(alias github25)
(alias github534)
Expand Down
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/github2033/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(library
(name hello_world)
(c_names file.xx))
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/github2033/dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 1.8)
Empty file.
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/github2033/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
. should be allowed in c names
$ dune build

0 comments on commit d300cde

Please sign in to comment.