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

[ Feature Request ] Linking c obj or lib files in manifest.json #1627

Open
tonis2 opened this issue Nov 16, 2024 · 7 comments
Open

[ Feature Request ] Linking c obj or lib files in manifest.json #1627

tonis2 opened this issue Nov 16, 2024 · 7 comments

Comments

@tonis2
Copy link
Contributor

tonis2 commented Nov 16, 2024

It would be nice to be able to provide some precompiled object files, bundled along in C3l libraries

Its easy to add the -l flag and just link the file, but currently the .o files are not copied into /tmp/ folder, from the c3l file,
so the path to the object file will be not working, when including the library.
In below manifest.json example the window.o would be copied to /build/tmp by c3 and then auto linked.

{ 
    "provides" : "window",
    "targets" : {
      "macos-x64" : {
        "linked-libraries" : ["Cocoa.framework"],
        "sources" : ["window.c3", "./scripts/window.o"]
      }
    }
  }

Maybe its already possible, but I haven't discovered how to get it working

@tonis2 tonis2 changed the title Linking .o files in manifest.json Feature request: Linking .o files in manifest.json Nov 16, 2024
@lerno
Copy link
Collaborator

lerno commented Nov 16, 2024

While this can certainly be added, isn't a static library a better solution?

@nmsobri
Copy link

nmsobri commented Nov 17, 2024

While this can certainly be added, isn't a static library a better solution?

@lerno how can i link to static library using package.json? i cant find it in the documentation

@tonis2
Copy link
Contributor Author

tonis2 commented Nov 17, 2024

I would be happy with static library too, these are the .a files I think ?
Basically compile the .o files with ar -rcs libname.a *.o

But yeah, how would it look like to include it to a manifest.json

@tonis2 tonis2 changed the title Feature request: Linking .o files in manifest.json [ Feature Request ] Linking .o files in manifest.json Nov 17, 2024
@tonis2 tonis2 changed the title [ Feature Request ] Linking .o files in manifest.json [ Feature Request ] Linking .o or .a files in manifest.json Nov 17, 2024
@tonis2 tonis2 changed the title [ Feature Request ] Linking .o or .a files in manifest.json [ Feature Request ] Linking c obj or lib files in manifest.json Nov 17, 2024
@lerno
Copy link
Collaborator

lerno commented Nov 17, 2024

You would just add it to "linked-libraries", like "linked-libraries": ["somepath/foo.a"]

@nmsobri
Copy link

nmsobri commented Nov 18, 2024

You would just add it to "linked-libraries", like "linked-libraries": ["somepath/foo.a"]

@lerno
do you have any documentation for all possible key/val for project.json ?, i mean from the generated project.json i cant see key linked-libraries

@tonis2
Copy link
Contributor Author

tonis2 commented Nov 18, 2024

@nmsobri
You can use c3c --list-project-properties on command line, to see project.json properties help

@nmsobri
Copy link

nmsobri commented Nov 18, 2024

@nmsobri You can use c3c --list-project-properties on command line, to see project.json properties help

awesome, this is what im looking for

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