Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

M1 MAC - libraries

42 views
Skip to first unread message

Rajagopalan Srinivasan 192/73

unread,
Jul 30, 2023, 7:34:39 PM7/30/23
to
What is the way to specify platform dependent Linker options on a Mac?

for linux I use something like the following in my gpr file:

case os is

when "GNU/Linux" =>

not sure what is equivalent for the M1 Mac?

thanks, Srini

Simon Wright

unread,
Jul 31, 2023, 3:59:04 AM7/31/23
to
What is "os" in the above? If it's the environment variable OS then,
indeed, there's no equivalent on macOS (either kind of silicon).

I don't know whether Windows defines "OS", but if it does you could just
set Darwin (or whatever) as the default?

OS := external ("OS", "Darwin");

If you're using Alire, the generated config/{crate}_config.gpr contains
on macOS

Alire_Host_OS := "macos";

Rajagopalan Srinivasan 192/73

unread,
Jul 31, 2023, 5:07:58 AM7/31/23
to
> Alire_Host_OS := "macOS";
Excellent suggestion. The following worked:

package Linker is
case audio_config.Alire_Host_OS is
when "macos" =>
for Switches("Ada") use ("-L/opt/homebrew/lib/", "-lsndfile");
when others =>
for Switches("Ada") use ("-lsndfile");
end case;
end Linker;

0 new messages