mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-08 13:37:33 +02:00
Added linking section
This commit is contained in:
parent
e6ebacae74
commit
d4cbdb7362
1 changed files with 10 additions and 0 deletions
|
@ -19,6 +19,7 @@ title: User Manual
|
||||||
- [Foreign Function Interface](#foreign-function-interface)
|
- [Foreign Function Interface](#foreign-function-interface)
|
||||||
- [Writing a Scheme Function in C](#writing-a-scheme-function-in-c)
|
- [Writing a Scheme Function in C](#writing-a-scheme-function-in-c)
|
||||||
- [Including a C Header File](#including-a-c-header-file)
|
- [Including a C Header File](#including-a-c-header-file)
|
||||||
|
- [Linking to a C Library](#linking-to-a-c-library)
|
||||||
- [Licensing](#licensing)
|
- [Licensing](#licensing)
|
||||||
- [References and Further Reading](#references-and-further-reading)
|
- [References and Further Reading](#references-and-further-reading)
|
||||||
|
|
||||||
|
@ -229,6 +230,15 @@ Or as part of a program (add any includes immediately after the `import` express
|
||||||
|
|
||||||
By default this will generate an `#include` preprocessor directive with the name of the header file in double quotes. However, if `include-c-header` is passed a text string with angle brackets (EG: `"<stdio.h>"`), the generated C code will use angle brackets instead.
|
By default this will generate an `#include` preprocessor directive with the name of the header file in double quotes. However, if `include-c-header` is passed a text string with angle brackets (EG: `"<stdio.h>"`), the generated C code will use angle brackets instead.
|
||||||
|
|
||||||
|
## Linking to a C Library
|
||||||
|
|
||||||
|
A Cyclone library may use the `c-linker-options` expression to instruct the compiler to include linker options when building an executable. For example:
|
||||||
|
|
||||||
|
(define-library (cyclone curl)
|
||||||
|
(include-c-header "<curl/curl.h>")
|
||||||
|
(export curl-version)
|
||||||
|
(c-linker-options "-lcurl")
|
||||||
|
|
||||||
# Licensing
|
# Licensing
|
||||||
Cyclone is available under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
|
Cyclone is available under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue