diff --git a/byterun/dune b/byterun/dune index 21ba79084..f5977e598 100644 --- a/byterun/dune +++ b/byterun/dune @@ -6,4 +6,24 @@ (mode (promote (until-clean))) (action - (run gcc -g %{main} %{runtime} -o %{target}))) + (run gcc %{read:mac-specific-flags.txt} -g %{main} %{runtime} -o %{target}))) + +(rule + (target mac-specific-flags.txt) + (enabled_if + (= %{system} "linux")) + (action + (progn + (with-stdout-to + %{target} + (run printf "-g"))))) + +(rule + (target mac-specific-flags.txt) + (enabled_if + (= %{system} "darwin")) + (action + (progn + (with-stdout-to + %{target} + (run printf "-arch x86_64 -ld_classic")))))