Skip to content

Commit

Permalink
Merge pull request #582 from talex5/build-if
Browse files Browse the repository at this point in the history
Simplify dune files with dune 3.9's build_if
  • Loading branch information
talex5 committed Jul 12, 2023
2 parents 7251db6 + 733f71f commit f69ba32
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 24 deletions.
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 3.7)
(lang dune 3.9)
(name eio)
(formatting disabled)
(generate_opam_files true)
Expand Down
2 changes: 1 addition & 1 deletion eio.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/eio"
doc: "https://ocaml-multicore.github.io/eio/"
bug-reports: "https://github.com/ocaml-multicore/eio/issues"
depends: [
"dune" {>= "3.7"}
"dune" {>= "3.9"}
"ocaml" {>= "5.0.0"}
"bigstringaf" {>= "0.9.0"}
"cstruct" {>= "6.0.1"}
Expand Down
2 changes: 1 addition & 1 deletion eio_linux.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/eio"
doc: "https://ocaml-multicore.github.io/eio/"
bug-reports: "https://github.com/ocaml-multicore/eio/issues"
depends: [
"dune" {>= "3.7"}
"dune" {>= "3.9"}
"alcotest" {>= "1.4.0" & with-test}
"eio" {= version}
"mdx" {>= "2.2.0" & with-test}
Expand Down
2 changes: 1 addition & 1 deletion eio_main.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/eio"
doc: "https://ocaml-multicore.github.io/eio/"
bug-reports: "https://github.com/ocaml-multicore/eio/issues"
depends: [
"dune" {>= "3.7"}
"dune" {>= "3.9"}
"mdx" {>= "2.2.0" & with-test}
"kcas" {>= "0.3.0" & with-test}
"yojson" {>= "2.0.2" & with-test}
Expand Down
2 changes: 1 addition & 1 deletion eio_posix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/eio"
doc: "https://ocaml-multicore.github.io/eio/"
bug-reports: "https://github.com/ocaml-multicore/eio/issues"
depends: [
"dune" {>= "3.7"}
"dune" {>= "3.9"}
"eio" {= version}
"iomux" {>= "0.2"}
"mdx" {>= "2.2.0" & with-test}
Expand Down
2 changes: 1 addition & 1 deletion eio_windows.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/eio"
doc: "https://ocaml-multicore.github.io/eio/"
bug-reports: "https://github.com/ocaml-multicore/eio/issues"
depends: [
"dune" {>= "3.7"}
"dune" {>= "3.9"}
"eio" {= version}
"kcas" {>= "0.3.0" & with-test}
"alcotest" {>= "1.4.0" & with-test}
Expand Down
10 changes: 1 addition & 9 deletions lib_eio_linux/tests/dune
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
(* -*- tuareg -*- *)

let linux = List.mem ("system", "linux") Jbuild_plugin.V1.ocamlc_config

let () = Jbuild_plugin.V1.send @@ if not linux then "" else {|

(library
(name eurcp_lib)
(enabled_if (= %{system} "linux"))
Expand Down Expand Up @@ -31,13 +25,11 @@ let () = Jbuild_plugin.V1.send @@ if not linux then "" else {|
(test
(name test)
(package eio_linux)
(enabled_if (= %{system} "linux"))
(build_if (= %{system} "linux"))
(modules test)
(libraries alcotest eio_linux))

(mdx
(package eio_linux)
(enabled_if (= %{system} "linux"))
(deps (package eio_linux)))

|}
10 changes: 1 addition & 9 deletions lib_eio_windows/test/dune
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
(* -*- tuareg -*- *)

let win32 = List.mem ("os_type", "Win32") Jbuild_plugin.V1.ocamlc_config

let () = Jbuild_plugin.V1.send @@ if not win32 then "" else {|

(test
(name test)
(package eio_windows)
(enabled_if (= %{os_type} "Win32"))
(build_if (= %{os_type} "Win32"))
(libraries alcotest kcas eio.mock eio_windows))

|}

0 comments on commit f69ba32

Please sign in to comment.