Skip to content

Commit a16068f

Browse files
committed
Document additional configuration needed for using the iconv binding
1 parent de956a6 commit a16068f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

build.sbt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,18 @@ lazy val bindings = project("bindings")
215215
lazy val libiconv = bindingProject("iconv")
216216
.configure(binding("iconv.h"))
217217
.settings(
218-
Test / nativeLinkingOptions ++= {
219-
// Link with libiconv on macOS.
218+
//#sbt-iconv-linking-options
219+
Compile / nativeLinkingOptions ++= {
220220
Option(System.getProperty("os.name")) match {
221221
case Some("Mac OS X") => Seq("-liconv")
222222
case _ => Seq.empty
223223
}
224224
}
225+
//#sbt-iconv-linking-options
226+
,
227+
Test / nativeLinkingOptions ++= {
228+
(Compile / nativeLinkingOptions).value
229+
}
225230
)
226231

227232
//#sbt-binding-project-multi-header

docs/src/paradox/bindings/iconv.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ To use this binding add the following resolver and the dependency:
66

77
@@binding[iconv]
88

9+
You also need to configure your build tool to link with the iconv library on macOS.
10+
For sbt, you can use the following code:
11+
12+
@@snip[sbt-iconv](../../../../build.sbt) { #sbt-iconv-linking-options }
13+
914
## Example
1015

1116
@@snip [iconv](../../../../bindings/iconv/src/test/scala/org/scalanative/bindgen/bindings/tests/IconvSpec.scala) { #usage-example }

0 commit comments

Comments
 (0)