Skip to content

Commit 0ad1d7d

Browse files
committed
📝 Use newer interface of compiler in document
1 parent d3612ed commit 0ad1d7d

1 file changed

Lines changed: 9 additions & 21 deletions

File tree

docs/GettingStartedCppCsharp.md

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,14 @@ $ cmake -B build
7373
- During configuration job, `compile_commands.json` will be generated at build directory.
7474

7575
```shell
76-
$ lilac-cxx -p build -o lilac.xml cxx/test.cxx
76+
$ lilac sym --from c++ -o lilac.xml -p build cxx/test.cxx
7777
```
7878

79-
- `-p build` make lilac-cxx use `build` as build directory
80-
- `-o lilac.xml` make lilac-cxx place output to `lilac.xml`
79+
- `sym --from c++` make `lilac` extract symbols from C++ sources
80+
- `-o lilac.xml` make `lilac` place output to `lilac.xml`
81+
- `-p build` make `lilac` use `build` as build directory
8182
- if arguments provided without option (such as `cxx/test.cxx`), given arguments will be considered as analyzing target
8283

83-
> [!WARNING]
84-
> If you encounter error such as `fatal error: *.h file not found`,
85-
> You can solve it with `-- -I /lib64/gcc/x86_64-pc-linux-gnu/14.2.1/include`.
86-
> (`/lib64/gcc/x86_64-pc-linux-gnu/14.2.1/include` should be replaced with one of your default include directory)
87-
> Arguments after `--` will be passed to `clang`. <br/>
88-
> Thus, `-- -I <your-include-dir>` will make `clang` to use correct include directory.
89-
> To execute `lilac-cxx` with this option, Use below:
90-
> ```shell
91-
> $ lilac-cxx -p build -o lilac.xml cxx/test.cxx -- -I /lib64/gcc/x86_64-pc-linux-gnu/14.2.1/include
92-
> ```
93-
9484
## Prepare C# project
9585

9686
```
@@ -138,15 +128,13 @@ Just use `cxx::CXXModule().Hello()` (C++) as `cxx.CXXModule().Hello()` (C#)!
138128
> See [this](https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke)
139129
140130
```shell
141-
$ ild --module=csharp -i lilac.xml -l test -o MyConsole/Test.cs
131+
$ lilac bind --to c# --sym lilac.xml --name Test -o MyConsole
142132
```
143133

144-
`ild` (interface ld) will convert your C++ interface data to C# binding.
145-
146-
- `--module=csharp` specifies target language is C#
147-
- `-i lilac.xml` makes `ild` to use `lilac.xml` as interface data
148-
- `-l test` assumes name of native library is `libtest.so` or `test.so` or `libtest.dll` or `test.dll` etc...
149-
- `-o MyConsole/Test.cs` let `ild` place C# binding to `MyConsole/Test.cs`
134+
- `bind --to c#` specifies target language is C#
135+
- `--sym lilac.xml` makes `lilac` to use `lilac.xml` as interface symbol
136+
- `--name test` assumes name of native library is `libtest.so` or `test.so` or `libtest.dll` or `test.dll` etc...
137+
- `-o MyConsole` let `lilac` place C# binding to `MyConsole/Test.cs`
150138

151139
Generated C# binding for given C++ source:
152140

0 commit comments

Comments
 (0)