@@ -125,13 +125,20 @@ during compilation:
125
125
[target.x86_64-fuchsia]
126
126
127
127
rustflags = [
128
- "-Lnative", " <SDK_PATH>/arch/x64/sysroot /lib",
129
- "-Lnative", " <SDK_PATH>/arch/x64/lib"
128
+ "-Lnative= <SDK_PATH>/arch/x64/lib",
129
+ "-Lnative= <SDK_PATH>/arch/x64/sysroot /lib"
130
130
]
131
131
```
132
132
133
133
* Note: Make sure to fill out ` <SDK_PATH> ` with the path to the downloaded [ Fuchsia SDK] .*
134
134
135
+ These options configure the following:
136
+
137
+ * ` -Lnative=${SDK_PATH}/arch/${ARCH}/lib ` : Link against Fuchsia libraries from
138
+ the SDK
139
+ * ` -Lnative=${SDK_PATH}/arch/${ARCH}/sysroot/lib ` : Link against Fuchsia kernel
140
+ libraries from the SDK
141
+
135
142
In total, our new project will look like:
136
143
137
144
** Current directory structure**
@@ -368,6 +375,7 @@ language called CML. The Fuchsia devsite contains an [overview of CML] and a
368
375
}
369
376
```
370
377
378
+ ** Current directory structure**
371
379
``` txt
372
380
hello_fuchsia/
373
381
┗━ pkg/
@@ -386,6 +394,9 @@ ${SDK_PATH}/tools/${ARCH}/cmc compile \
386
394
-o pkg/meta/hello_fuchsia.cm
387
395
```
388
396
397
+ * Note: ` --includepath ` tells the compiler where to look for ` include ` s from our CML.
398
+ In our case, we're only using ` syslog/client.shard.cml ` .*
399
+
389
400
** Current directory structure**
390
401
``` txt
391
402
hello_fuchsia/
@@ -397,19 +408,16 @@ hello_fuchsia/
397
408
┗━ hello_fuchsia.cml
398
409
```
399
410
400
- * Note: ` --includepath ` tells the compiler where to look for ` include ` s from our CML.
401
- In our case, we're only using ` syslog/client.shard.cml ` .*
402
-
403
411
### Building a Fuchsia package
404
412
405
413
Next, we'll build a package manifest as defined by our manifest:
406
414
407
415
``` sh
408
416
${SDK_PATH} /tools/${ARCH} /pm \
409
- -o hello_fuchsia_manifest \
417
+ -o pkg/ hello_fuchsia_manifest \
410
418
-m pkg/hello_fuchsia.manifest \
411
419
build \
412
- -output-package-manifest hello_fuchsia_package_manifest
420
+ -output-package-manifest pkg/ hello_fuchsia_package_manifest
413
421
```
414
422
415
423
This will produce ` pkg/hello_fuchsia_manifest/ ` which is a package manifest we can
@@ -469,15 +477,15 @@ We can publish our new package to that repository with:
469
477
470
478
``` sh
471
479
${SDK_PATH} /tools/${ARCH} /pm publish \
472
- -repo repo \
473
- -lp -f <( echo " hello_fuchsia_package_manifest" )
480
+ -repo pkg/ repo \
481
+ -lp -f <( echo " pkg/ hello_fuchsia_package_manifest" )
474
482
```
475
483
476
484
Then we can add the repository to ` ffx ` 's package server as ` hello-fuchsia ` using:
477
485
478
486
``` sh
479
487
${SDK_PATH} /tools/${ARCH} /ffx repository add-from-pm \
480
- repo \
488
+ pkg/ repo \
481
489
-r hello-fuchsia
482
490
```
483
491
0 commit comments