File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
test/blackbox-tests/test-cases/custom-cross-compilation Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -865,10 +865,11 @@ module Builder = struct
865865 =
866866 Options_implied_by_dash_p. term
867867 and + x =
868+ let doc = " Cross-compile using this toolchain." in
868869 Arg. (
869870 value
870871 & opt (some Arg. context_name) None
871- & info [ " x" ] ~docs ~doc: (Some " Cross-compile using this toolchain. " ))
872+ & info [ " x" ] ~docs ~doc: (Some doc) ~env: ( Cmd.Env. info ~doc " DUNE_CROSS_TARGET " ))
872873 and + target_exec =
873874 let doc =
874875 " Wrapper command for running target binaries when cross-compiling. Format: \
Original file line number Diff line number Diff line change @@ -137,6 +137,29 @@ Build with -x test_toolchain and environment variable DUNE_TARGET_EXEC=test_tool
137137 ---- HELLO END ----
138138
139139
140+ Build with environment variables DUNE_CROSS_TARGET =test_toolchain and DUNE_TARGET_EXEC =test_toolchain =test_toolchain_wrapper .sh
141+ (should cross compile and use target binary ./ hello. exe wrapped with the wrapper)
142+
143+ $ PATH ="$PWD /bin :$PATH " DUNE_CROSS_TARGET =test_toolchain DUNE_TARGET_EXEC =test_toolchain =test_toolchain_wrapper .sh dune build @runhello --force
144+ ---- HELLO START ----
145+ Hello from OCaml !
146+ PWD : $TESTCASE_ROOT /_build /default
147+ Args : ./hello .exe --hello-arg1 --hello-arg2
148+ ---- HELLO END ----
149+
150+ === TEST_TOOLCHAIN WRAPPER START ===
151+ WRAPPER PWD : $TESTCASE_ROOT /_build /default .test_toolchain
152+ WRAPPER executing : $TESTCASE_ROOT /_build /default .test_toolchain /hello .exe --hello-arg1 --hello-arg2
153+ === WRAPPER EXEC ===
154+ ---- HELLO START ----
155+ Hello from OCaml !
156+ PWD : $TESTCASE_ROOT /_build /default .test_toolchain
157+ Args : $TESTCASE_ROOT /_build /default .test_toolchain /hello .exe --hello-arg1 --hello-arg2
158+ ---- HELLO END ----
159+
160+
161+
162+
140163
141164Build with -x test_toolchain and --target-exec with arguments
142165(should use target binary ./ hello. exe wrapped with the wrapper)
You can’t perform that action at this time.
0 commit comments