nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.26k stars 322 forks source link

Wasm-wc: Add nxt_unit.o as a dependency in the auto script #1148

Closed ac000 closed 4 months ago

ac000 commented 4 months ago

Rather than calling make itself to build nxt_unit.o make nxt_unit.o a dependency of the main module build target.

After this patch

$ make
cc -c -pipe -fPIC -fvisibility=hidden -O0 -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-prototypes  -g   -I src -I build/include   \
                      \
                     \
-o build/src/nxt_unit.o \
-MMD -MF build/src/nxt_unit.dep -MT build/src/nxt_unit.o \
src/nxt_unit.c

Compared to before

$ make
make build/src/nxt_unit.o
make[1]: Entering directory '/home/andrew/src/unit'
cc -c -pipe -fPIC -fvisibility=hidden -O0 -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-prototypes  -g   -I src -I build/include   \
                      \
                     \
-o build/src/nxt_unit.o \
-MMD -MF build/src/nxt_unit.dep -MT build/src/nxt_unit.o \
src/nxt_unit.c
thresheek commented 4 months ago

The second patch also looks good to me. Works as intended.

Thanks!

ac000 commented 4 months ago

Rebased with master

$ git range-diff c5956b79...d54af163
-:  -------- > 1:  3f805bc6 Packages: added wasm-wasi-component module packaging for deb-based distros
-:  -------- > 2:  7a640556 Packages: added wasm-wasi-component module packaging for rpm-based distros
1:  c0ee1461 = 3:  7b13c306 Wasm-wc: Add nxt_unit.o as a dependency in the auto script
2:  c5956b79 = 4:  d54af163 Wasm-wc: Use the cargo build output as the make target dependency