From 259b52bb833cc45d118cb6cc361b9224553d23e4 Mon Sep 17 00:00:00 2001 From: Kakadu Date: Thu, 27 Feb 2025 23:35:42 +0300 Subject: [PATCH] Add mac-specific flags to compile byterun on Darwin Signed-off-by: Kakadu --- byterun/dune | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) 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")))))