Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "late" linkoptions #416

Open
codecat opened this issue Mar 5, 2019 · 4 comments
Open

Add a "late" linkoptions #416

codecat opened this issue Mar 5, 2019 · 4 comments

Comments

@codecat
Copy link
Contributor

codecat commented Mar 5, 2019

In the scripting reference for GENie it is mentioned that you can use pkg-config-style linker options. Which is great, but in practice it doesn't really work if you're using static libraries, because objects get placed after the link options, which means that commands like wx-config are ran too early, and the project won't be able to link against wx.

A possible solution to this would be some kind of "late" linkoptions function, which would let me add linkoptions some place after the project's object files.

I noticed #125 solved a similar problem, but that doesn't particularly work with things like wx-config.

@codecat
Copy link
Contributor Author

codecat commented Mar 14, 2019

I have found a workaround for this myself, but perhaps it's still worth looking into in the future - instead of just passing the output of wx-config to the linker options, I parse the output, find the included static libraries, and add those with link instead of linkoptions. eg:

for i, v in ipairs(libFlags) do
	if v:sub(1, 1) ~= '-' then
		links(v)
	else
		linkoptions(v)
	end
end

Not the nicest or cleanest solution, but it works.

@flamendless
Copy link

@codecat how do you do that exactly? I think this is what i also need to link gtk using pkg-config

@codecat
Copy link
Contributor Author

codecat commented Mar 28, 2021

Sorry this issue was a long time ago, I don't know the details of it anymore. I've also mostly switched over to Premake5 myself.

@flamendless
Copy link

@codecat i see. I'll try premake5 then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@codecat @flamendless and others