Open
Description
The -shared
and -static
flags are linkage flags, and don't do anything when passed alongside -c
.
Taking the example from shared_flag:
cc::Build::new()
.file("src/foo.c")
.shared_flag(true)
.compile("libfoo.so");
What that does is:
cc $OTHER_FLAGS -shared -o foo.o -c src/foo.c
ar cq libfoo.so.a foo.o
ar s libfoo.so.a
The first command is strictly equivalent to cc $OTHER_FLAGS -o foo.o -c src/foo.c
. So in practice, it makes no difference whether shared_flag was passed or not, and compile("libfoo.so")
would make you think you'd end up with a dynamic library, but you don't.
Metadata
Metadata
Assignees
Labels
No labels