File tree 4 files changed +17
-1
lines changed
4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
Unreleased
2
2
----------
3
3
4
+ - Add a ` %{toolchain} ` expansion variable (#4899 , fixes #3949 , @rgrinberg )
5
+
4
6
- Include dependencies of executables when creating toplevels (either `dune
5
7
top` or ` dune utop`) (#4882 , fixes #4872 , @Gopiancode )
6
8
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ module Var = struct
44
44
| Test
45
45
| Corrected_suffix
46
46
| Inline_tests
47
+ | Toolchain
47
48
48
49
let compare : t -> t -> Ordering.t = Poly. compare
49
50
@@ -94,6 +95,7 @@ module Var = struct
94
95
| Test -> " Test"
95
96
| Corrected_suffix -> " Corrected_suffix"
96
97
| Inline_tests -> " Inline_tests"
98
+ | Toolchain -> " Toolchain"
97
99
in
98
100
Dyn. Variant (cstr, [] )
99
101
end
@@ -285,6 +287,7 @@ let encode_to_latest_dune_lang_version t =
285
287
| Test -> Some " test"
286
288
| Corrected_suffix -> Some " corrected-suffix"
287
289
| Inline_tests -> Some " inline_tests"
290
+ | Toolchain -> Some " toolchain"
288
291
with
289
292
| None -> Pform_was_deleted
290
293
| Some name -> Success { name; payload = None })
@@ -469,6 +472,7 @@ module Env = struct
469
472
; (" input-file" , since ~version: (1 , 0 ) Var. Input_file )
470
473
; (" corrected-suffix" , No_info Corrected_suffix )
471
474
; (" inline_tests" , No_info Inline_tests )
475
+ ; (" toolchains" , since ~version: (3 , 0 ) Var. Toolchain )
472
476
]
473
477
in
474
478
String.Map. of_list_exn (List. concat [ lowercased; uppercased; other ])
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ module Var : sig
44
44
| Test
45
45
| Corrected_suffix
46
46
| Inline_tests
47
+ | Toolchain
47
48
48
49
val compare : t -> t -> Ordering .t
49
50
Original file line number Diff line number Diff line change @@ -371,7 +371,16 @@ let expand_pform_gen ~(context : Context.t) ~bindings ~dir ~source
371
371
| Ccomp_type ->
372
372
static
373
373
(string
374
- (Ocaml_config.Ccomp_type. to_string context.lib_config.ccomp_type)))
374
+ (Ocaml_config.Ccomp_type. to_string context.lib_config.ccomp_type))
375
+ | Toolchain ->
376
+ static
377
+ (string
378
+ (match context.findlib_toolchain with
379
+ | Some toolchain -> Context_name. to_string toolchain
380
+ | None ->
381
+ let loc = Dune_lang.Template.Pform. loc source in
382
+ User_error. raise ~loc
383
+ [ Pp. text " No toolchain defined for this context" ])))
375
384
| Macro (macro , s ) -> (
376
385
match macro with
377
386
| Ocaml_config ->
You can’t perform that action at this time.
0 commit comments