From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Exporting linker options from library GPR Date: Tue, 13 Feb 2018 20:42:00 +0000 Organization: A noiseless patient Spider Message-ID: References: <981893565.540207668.848900.laguest-archeia.com@nntp.aioe.org> <101626dd-bbd5-4e10-a383-3c5e29d4bc88@googlegroups.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: reader02.eternal-september.org; posting-host="0b852e40190820e0f08a03d313e97d15"; logging-data="13277"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Z1mTfmvsHckwRRcC/q4w7bUdS5OvhrKk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:nTft/b5Qmwd0HqhD820BQpho5tc= sha1:htyszE9c3qV8Z8/FK53WMwdbEeY= Xref: reader02.eternal-september.org comp.lang.ada:50431 Date: 2018-02-13T20:42:00+00:00 List-Id: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Lucretia writes: > On Tuesday, 13 February 2018 09:43:49 UTC, Luke A. Guest wrote: > >> Just seen this. I have actually built SDLAda on Mac OS X, but I didn’t push >> the changes required to get the thing built with the SDL2 framework. > > Just checked, I did it on the command line as a hack to get it > compiling on Mac. > > It seems that GPR's cannot expand `sdl2-config --cflags` when passed > via the GPR Default_Switches mechanism, if there's a way, I could > clean up the makefile a bit more and shift more to the GPR. There's probably a way if you use the makefile. I hacked an sdlada_mac.gpr: --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=sdlada_mac.gpr Content-Description: Mac/Framework compatible GPR project SDLAda_Mac is Version := "2.2.0"; type Platform_Type is ("linux", "bsd", "windows", "macosx", "ios", "android"); type Mode_Type is ("debug", "release"); type Build_Type is ("static", "shared"); Platform : Platform_Type := external ("SDL_PLATFORM", "macosx"); Mode : Mode_Type := external ("SDL_MODE", "debug"); Build : Build_Type := external ("SDL_BUILD", "shared"); for Languages use ("Ada", "C"); for Source_Dirs use ("../../src", "../../src/" & Platform, "gen/src/"); for Library_Name use "sdlada"; for Object_Dir use "gen/" & Build & "." & Mode & "/lib/.obj"; for Library_Dir use "gen/" & Build & "." & Mode & "/lib"; for Library_Version use "libsdlada.so." & Version; Linking_Options := ("-F", external ("HOME") & "/Library/Frameworks", "-framework", "SDL2"); case Build is when "static" => for Library_Kind use "static"; when "shared" => for Library_Kind use "relocatable"; for Library_Options use Linking_Options; end case; package Compiler is C_Switches := ("-I" & external ("HOME") & "/Library/Frameworks/SDL2.framework/Headers"); Ada_Switches := ("-gnat2012", "-gnata", "-gnato", "-gnatE", "-gnaty", "-gnatyM120"); case Mode is when "debug" => C_Switches := C_Switches & ("-O0", "-g"); Ada_Switches := Ada_Switches & ("-O0", "-g"); when "release" => C_Switches := C_Switches & ("-O2", "-g"); Ada_Switches := Ada_Switches & ("-O2", "-g"); end case; for Default_Switches ("C") use C_Switches; for Default_Switches ("Ada") use Ada_Switches; end Compiler; package Linker is for Linker_Options use Linking_Options; end Linker; end SDLAda_Mac; --=-=-=--