14
14
- [ CLI] ( #cli )
15
15
- [ ` bootstrap ` ] ( #bootstrap )
16
16
- [ ` install ` ] ( #install )
17
- - [ ` install-manifest ` ] ( #install-manifest )
17
+ - [ ` clang ` and ` clang++ ` ] ( #clang-and-clang )
18
18
- [ Core] ( #core )
19
19
- [ VcpkgRootInit] ( #vcpkgrootinit )
20
20
- [ VcpkgNativeConfig] ( #vcpkgnativeconfig )
@@ -75,7 +75,7 @@ There are several modules of interest:
75
75
You can quickly test it by running:
76
76
77
77
```
78
- $ cs launch com.indoorvivants.vcpkg:sn-vcpkg_3:0.0.11 -- install libpq -l -q -c
78
+ $ cs launch com.indoorvivants.vcpkg:sn-vcpkg_3:0.0.13 -- install libpq -l -q -c
79
79
-I<...>/sbt-vcpkg/vcpkg-install/arm64-osx/lib/pkgconfig/../../include
80
80
-L<...>/sbt-vcpkg/vcpkg-install/arm64-osx/lib/pkgconfig/../../lib
81
81
-L<...>/sbt-vcpkg/vcpkg-install/arm64-osx/lib/pkgconfig/../../lib/pkgconfig/../../lib
@@ -101,7 +101,7 @@ There are several modules of interest:
101
101
For SBT, add this to your ` project/plugins.sbt ` :
102
102
103
103
``` scala
104
- addSbtPlugin(" com.indoorvivants.vcpkg" % " sbt-vcpkg" % " 0.0.11 " )
104
+ addSbtPlugin(" com.indoorvivants.vcpkg" % " sbt-vcpkg" % " 0.0.13 " )
105
105
```
106
106
107
107
And in your build.sbt:
@@ -137,7 +137,7 @@ Tasks and settings (find them all by doing `help vcpkg*` in SBT shell):
137
137
Add dependency to your ` build.sc ` :
138
138
139
139
``` scala
140
- import $ivy .`com.indoorvivants.vcpkg::mill-vcpkg:0.0.11 `
140
+ import $ivy .`com.indoorvivants.vcpkg::mill-vcpkg:0.0.13 `
141
141
```
142
142
143
143
And use the ` VcpkgModule ` mixin:
@@ -164,7 +164,7 @@ The Mill tasks are the same as in the SBT plugin
164
164
In ` project/plugins.sbt ` :
165
165
166
166
``` scala
167
- addSbtPlugin(" com.indoorvivants.vcpkg" % " sbt-vcpkg-native" % " 0.0.11 " )
167
+ addSbtPlugin(" com.indoorvivants.vcpkg" % " sbt-vcpkg-native" % " 0.0.13 " )
168
168
```
169
169
170
170
In ` build.sbt ` :
@@ -194,7 +194,7 @@ For real world usage, see [Examples](#examples).
194
194
Add dependency to your ` build.sc ` :
195
195
196
196
``` scala
197
- import $ivy .`com.indoorvivants.vcpkg::mill-vcpkg-native:0.0.11 `
197
+ import $ivy .`com.indoorvivants.vcpkg::mill-vcpkg-native:0.0.13 `
198
198
```
199
199
200
200
And use the ` VcpkgNativeModule ` mixin:
@@ -268,18 +268,24 @@ Options and flags:
268
268
269
269
#### ` install `
270
270
271
- Install one or several dependencies, and optionally output linking/compilation flags for all of them.
271
+ Install one or several dependencies, by name or from a manifest file, and optionally output linking/compilation flags for all of them.
272
272
273
- Example: ` sn-vcpkg install libgit2 cjson -l -c `
273
+ Examples:
274
+ - ` sn-vcpkg install libgit2 cjson -l -c `
275
+ - ` sn-vcpkg install --manifest vcpkg.json -l -c `
274
276
275
277
```
276
- Usage: sn-vcpkg install [--output-compilation] [--output-linking] [--vcpkg-root-manual <location> [--no-bootstrap] | --vcpkg-root-env <env-var> [--no-bootstrap] | --no-bootstrap] [--vcpkg-install <dir>] [--no-bootstrap] [--verbose] [--quiet] <dep>...
278
+ Usage:
279
+ sn-vcpkg install --manifest <string> [--output-compilation] [--output-linking] [--vcpkg-root-manual <location> [--no-bootstrap] | --vcpkg-root-env <env-var> [--no-bootstrap] | --no-bootstrap] [--vcpkg-install <dir>] [--no-bootstrap] [--verbose] [--quiet]
280
+ sn-vcpkg install [--output-compilation] [--output-linking] [--vcpkg-root-manual <location> [--no-bootstrap] | --vcpkg-root-env <env-var> [--no-bootstrap] | --no-bootstrap] [--vcpkg-install <dir>] [--no-bootstrap] [--verbose] [--quiet] <dep>...
277
281
278
282
Install a list of vcpkg dependencies
279
283
280
284
Options and flags:
281
285
--help
282
286
Display this help text.
287
+ --manifest <string>
288
+ vcpkg manifest file
283
289
--output-compilation, -c
284
290
Output (to STDOUT) compilation flags for installed libraries, one per line
285
291
--output-linking, -l
@@ -298,39 +304,59 @@ Options and flags:
298
304
Only error logging
299
305
```
300
306
301
- #### ` install-manifest `
307
+ #### ` clang ` and ` clang++ `
302
308
303
- Install dependencies from a manifest file, and optionally output linking/compilation flags for all of them.
309
+ These commands invoke clang or clang++ with all the configuration
310
+ flags required [ ^ 1 ] to run the specified dependencies.
304
311
305
- Example: ` sn-vcpkg install-manifest vcpkg.json -l -c `
312
+ For example, say you have a snippet of C code that needs sqlite3 dependency:
306
313
314
+ ``` c
315
+ #include < stdio.h>
316
+ #include < sqlite3.h>
317
+
318
+ int main (int argc, char* argv[ ] ) {
319
+ sqlite3 * db;
320
+ char * zErrMsg = 0;
321
+ int rc;
322
+
323
+ rc = sqlite3_open("test.db", &db);
324
+
325
+ if( rc ) {
326
+ fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
327
+ return(0);
328
+ } else {
329
+ fprintf(stderr, "Opened database successfully\n");
330
+ }
331
+ sqlite3_close(db);
332
+ }
307
333
```
308
- Usage: sn-vcpkg install-manifest [--output-compilation] [--output-linking] [--vcpkg-root-manual <location> [--no-bootstrap] | --vcpkg-root-env <env-var> [--no-bootstrap] | --no-bootstrap] [--vcpkg-install <dir>] [--no-bootstrap] [--verbose] [--quiet] <vcpkg manifest file>
309
334
310
- Install vcpkg dependencies from a manifest file (like vcpkg.json)
335
+ You can compile it directly by running
311
336
312
- Options and flags:
313
- --help
314
- Display this help text.
315
- --output-compilation, -c
316
- Output (to STDOUT) compilation flags for installed libraries, one per line
317
- --output-linking, -l
318
- Output (to STDOUT) linking flags for installed libraries, one per line
319
- --vcpkg-root-manual <location>
320
- Initialise vcpkg in this location
321
- --no-bootstrap
322
- Allow bootstrapping vcpkg from scratch
323
- --vcpkg-root-env <env-var>
324
- Pick up vcpkg root from the environment variable
325
- --vcpkg-install <dir>
326
- folder where packages will be installed
327
- --verbose, -v
328
- Verbose logging
329
- --quiet, -q
330
- Only error logging
337
+ ```
338
+ sn-vcpkg clang sqlite3 -- test-sqlite.c
331
339
```
332
340
341
+ Or if you have a vcpkg manifest file:
333
342
343
+ ```json
344
+ {
345
+ "name": "my-application",
346
+ "version": "0.15.2",
347
+ "dependencies": ["sqlite3"]
348
+ }
349
+ ```
350
+
351
+ You can use that as well:
352
+
353
+ ```
354
+ sn-vcpkg clang --manifest vcpkg.json -- test-sqlite.c
355
+ ```
356
+
357
+ All the arguments after ` -- ` will be passed to clang/clang++ without modification (_ before_ the flags calculated for dependencies)
358
+
359
+ [ ^ 1 ] : as long as the dependencies themselves provide a well configured pkg-config file, of course
334
360
335
361
### Core
336
362
@@ -359,7 +385,7 @@ compilation arguments from installed vcpkg dependencies.
359
385
** Defaults**
360
386
``` scala
361
387
VcpkgNativeConfig ()
362
- // res3 : VcpkgNativeConfig = Vcpkg NativeConfig:
388
+ // res2 : VcpkgNativeConfig = Vcpkg NativeConfig:
363
389
// | approximate = true
364
390
// | autoConfigure = true
365
391
// | prependCompileOptions = true
@@ -404,7 +430,7 @@ VcpkgNativeConfig().withPrependLinkingOptions(true)
404
430
``` scala
405
431
// Completely overwrite
406
432
VcpkgNativeConfig ().withRenamedLibraries(Map (" cjson" -> " libcjson" , " cmark" -> " libcmark" ))
407
- // res8 : VcpkgNativeConfig = Vcpkg NativeConfig:
433
+ // res7 : VcpkgNativeConfig = Vcpkg NativeConfig:
408
434
// | approximate = true
409
435
// | autoConfigure = true
410
436
// | prependCompileOptions = true
@@ -414,7 +440,7 @@ VcpkgNativeConfig().withRenamedLibraries(Map("cjson" -> "libcjson", "cmark" -> "
414
440
415
441
// Append only
416
442
VcpkgNativeConfig ().addRenamedLibrary(" cjson" , " libcjson" )
417
- // res9 : VcpkgNativeConfig = Vcpkg NativeConfig:
443
+ // res8 : VcpkgNativeConfig = Vcpkg NativeConfig:
418
444
// | approximate = true
419
445
// | autoConfigure = true
420
446
// | prependCompileOptions = true
@@ -431,7 +457,7 @@ Specification for vcpkg dependencies. Can be either:
431
457
432
458
``` scala
433
459
VcpkgDependencies (" cmark" , " cjson" )
434
- // res10 : VcpkgDependencies = Names(
460
+ // res9 : VcpkgDependencies = Names(
435
461
// deps = List(
436
462
// Dependency(name = "cmark", features = Set()),
437
463
// Dependency(name = "cjson", features = Set())
@@ -443,14 +469,14 @@ VcpkgDependencies("cmark", "cjson")
443
469
444
470
``` scala
445
471
VcpkgDependencies (new java.io.File (" ./vcpkg.json" ))
446
- // res11 : VcpkgDependencies = ManifestFile(path = ./vcpkg.json)
472
+ // res10 : VcpkgDependencies = ManifestFile(path = ./vcpkg.json)
447
473
```
448
474
449
475
- a list of detailed dependency specs:
450
476
451
477
``` scala
452
478
VcpkgDependencies .Names (List (Dependency (" libpq" , Set (" arm-build" )), Dependency .parse(" cpprestsdk[boost]" )))
453
- // res12 : Names = Names(
479
+ // res11 : Names = Names(
454
480
// deps = List(
455
481
// Dependency(name = "libpq", features = Set("arm-build")),
456
482
// Dependency(name = "cpprestsdk", features = Set("boost"))
0 commit comments