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

Linking ".a" archive file is unsupported. #2219

Open
1 task done
tmathews opened this issue Jun 20, 2024 · 2 comments
Open
1 task done

Linking ".a" archive file is unsupported. #2219

tmathews opened this issue Jun 20, 2024 · 2 comments
Labels

Comments

@tmathews
Copy link

tmathews commented Jun 20, 2024

What seems to be the problem?
Using the links method to include an .a archive file incorrectly supplements the library with a flag instead of just providing the library path. The archive file will be prefixed with -l and the relative path to the file is omitted. e.g. -llibrary.a instead of my/custom/library.a.

What did you expect to happen?
I expect the LIBS make variable to be supplemented with the archive file path. e.g. LIBS=... my/custom/library.a.

What have you tried so far?
Researching docs for alternative methods. None tried provided the required outcome. Manually adding the archive path to the LIBS variable in the make file successfully statically links.

How can we reproduce this?
Use the link method like so:

links({"./my/custom/library.a"})
  • GNU Makefile 2 (gmake2)

What version of Premake are you using?
5.0.0-beta2

@tmathews tmathews added the bug label Jun 20, 2024
@Jarod42
Copy link
Contributor

Jarod42 commented Jun 21, 2024

BTW, why using links { "my/custom/library.a" } instead of

links { "rary" } -- without 'lib' prefix ;-)
libdirs { "my/custom" }

?

@tmathews
Copy link
Author

tmathews commented Jun 21, 2024

Because this will produce the incorrect Make file configuration. As stated, it will produce -lrary flags instead of directly linking the archive file.

Additionally putting the .a file in the files list gets ignored too.

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

No branches or pull requests

2 participants