comp.lang.ada
 help / color / mirror / Atom feed
From: "Rajagopalan Srinivasan 192/73" <rsrinivasan@alumni.iitm.ac.in>
Subject: Re: M1 MAC - libraries
Date: Mon, 31 Jul 2023 02:07:56 -0700 (PDT)	[thread overview]
Message-ID: <9ec74936-e79c-4cea-8304-b45237d8e61cn@googlegroups.com> (raw)
In-Reply-To: <ly8rawa4vw.fsf@pushface.org>

On Monday, July 31, 2023 at 3:59:04 AM UTC-4, Simon Wright wrote:
> "Rajagopalan Srinivasan 192/73" <rsrin...@alumni.iitm.ac.in> writes: 
> 
> > 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?
> 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";
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;

  reply	other threads:[~2023-07-31  9:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-30 23:34 M1 MAC - libraries Rajagopalan Srinivasan 192/73
2023-07-31  7:58 ` Simon Wright
2023-07-31  9:07   ` Rajagopalan Srinivasan 192/73 [this message]
2023-07-31 16:25   ` Dennis Lee Bieber
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox