Closed fastrgv closed 8 years ago
Hello,
concerning the use of -framework vs -Wl,-framework: this is documented in the gcc manual and we prefer not to duplicate that in the gprbuild manual.
I don't have problem with -Xlinker. This project is accepted:
project Hello is
for Main use ("hello.adb");
package Linker is
for Default_Switches ("Ada") use ("-Xlinker", "-v");
end Linker;
end Hello;
Regards, Tristan.
Sorry, I was wrong about Xlinker.
However, I think you missed my point on the other issue.
package Linker is for Default_Switches ("Ada") use ("-framework", "OpenGL"); end linker;
does NOT work but
package Linker is for Default_Switches ("Ada") use ("-framework", "/OpenGL"); end linker;
DOES work.
Rod
On Wed, Jun 15, 2016 at 2:31 AM, Vasiliy Fofanov notifications@github.com wrote:
Closed #9 https://github.com/AdaCore/gprbuild/issues/9.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdaCore/gprbuild/issues/9#event-692987405, or mute the thread https://github.com/notifications/unsubscribe/AGI_4SYNF9ErbE6zrcKx8jSIDaadiKRYks5qL8aHgaJpZM4Iz17m .
However, I think you missed my point on the other issue.
package Linker is for Default_Switches ("Ada") use ("-framework", "OpenGL"); end linker;
does NOT work but
package Linker is for Default_Switches ("Ada") use ("-framework", "/OpenGL"); end linker;
DOES work.
This isn't related to gprbuild, which just passes corresponding parameters to the linker driver. Your issue is that the linker driver expects a slash there, and underlying linker doesn't. This is not a builder issue.
Without the slash, the builder inserts a string (roughly equivalent to $PWD) that I do not want inserted. How may I prevent that insertion?
Ah. Indeed, looks like a simple string passed as a switch in package Linker gets converted to $PWD + string. This is unexpected to me, and looks like something we've been doing for many years - we probably had our reasons, but not necessarily good ones :) I'll investigate.
Reopening in the meantime.
This is fixed now.
After reading the documentation and struggling on OS-X to create a working gpr file I found, by accident, that the magic words to add to Linker'Default_Switches to reference the intrinsic OpenGL framework are:
package Linker is for Default_Switches ("ada") use ("-framework", "/OpenGL"); end Linker;
which, to me is not obvious. However I found the following more obvious solution
package Linker is for Default_Switches("ada") use ("-Wl,-framework,OpenGL"); end Linker;
thanks to a more knowledgeable friend.
Finally, I have one lingering question: why is the "-Xlinker" switch "not recognized" on OS-X? It works perfectly well as an option in a normal script. Thank You.