Hi,
Noob here i was learning to use mojom interface and got stuck for four days now with this error here.
ninja: error: unknown target '/home/user_name/chromium/src/example/public/mojom'
what i did:
1. ~/chromium/src$ mkdir -p example/public/mojom
2. ~/chromium/src/example/public/mojom$ touch ping_responder.mojom && nano ping_responder.mojom
pasted this interface data in ping_responder.mojom
module example.mojom;
interface PingResponder {
// Receives a "Ping" and responds with a random integer.
Ping() => (int32 random);
};
3. ~/chromium/src/example/public/mojom$ touch BUILD.gn && nano BUILD.gn
pasted this details in BUILD.gn
import("//mojo/public/tools/bindings/mojom.gni")
mojom("mojom") {
sources = [ "ping_responder.mojom" ]
}
4. ~/chromium/src/example/public/mojom$ gn gen out/r
i did this because of step 5 threw an error of not finding the out/r directory while excuting the command on step 5 (am not sure if this i right)
5.~/chromium/src/example/public/mojom$ ninja -C out/r ~/chromium/src/example/public/mojom
hope one you guys can spot my mistake there. also on top of that i would like to ask these questions here
1. is it right to create a BUILD.gn manualy like how i did on step 3 there.
(i asked because i was thinking that BUILD.gn is suposed
to be automatically genreated from a certain command that i don't know like (ie. gn gen
args.gn)
2. i get comfused by the ending line of this ninja statement while building js bingings and c++ bindings because the former (js) adds a colon and the other doesn't.
for c++
ninja -C out/r ~/chromium/src/example/public/mojom
for js
ninja -C out/r services/echo/public/interfaces:interfaces_js
NB; just stabed this group while searching for solution am not as well sure if its a right place to post this, in any case if this is not an apropriate place for this i present my apologies in advance in respect to ever one annoyed by my post thanks.