79220111

Date: 2024-11-24 13:02:17
Score: 0.5
Natty:
Report link

It's dirty and will break if there are spaces in the filename but Rust allows passing custom linker arguments.

Adding the static library to linker arguments allow it to be included during linkage on my machine:

custom_target('cargo-with-my_static_lib',
    # ...
    env: {
        'CARGO_ENCODED_RUSTFLAGS': '\x1f'.join(['-C','link-args='+my_static_lib.full_path()]),
    },
    depends: my_static_lib,
)
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Devilish Spirits