Skip to content

Commit 3b7fc1e

Browse files
Update READMEs
1 parent 6941ae2 commit 3b7fc1e

File tree

3 files changed

+53
-90
lines changed

3 files changed

+53
-90
lines changed

example/README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,14 @@ to a XIB in your own project:
6666

6767
### Windows
6868

69-
Open the `Example Embedder` Visual Studio solution file under `windows_fde\` and
70-
build the GLFW Example project.
69+
Open the `Example Embedder` Visual Studio solution file under `windows_fde\` to
70+
build and run the GLFW Example project.
7171

72-
The resulting binary will be in `bin\x64\$(Configuration)\GLFW Example\`. It
73-
currently uses relative paths so must be run from the `windows_fde\` directory:
72+
The resulting binary will be in
73+
`example\build\windows_fde\x64\$(Configuration)\GLFW Example\`. It currently
74+
uses relative paths so if you run it manually it must be run from the
75+
`example\windows_fde\` directory. E.g.:
7476

7577
```
76-
> ".\bin\x64\$(Configuration)\GLFW Example\GLFW Example.exe"
78+
> "..\build\windows_fde\x64\Debug\GLFW Example\GLFW Example.exe"
7779
```
78-
79-
e.g.:
80-
81-
```
82-
> ".\bin\x64\Debug Dynamic Library\GLFW Example\GLFW Example.exe"
83-
```
84-
85-
Or you can use Visual Studio's inbuilt debugger to build and run the
86-
example application automatically.

library/GN.md

Lines changed: 0 additions & 66 deletions
This file was deleted.

library/README.md

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ the ICU data from the Flutter engine.
3737

3838
#### Dependencies
3939

40+
**Libraries**
41+
4042
First you will need to install the relevant library dependencies:
4143
* GLFW3
4244
* GTK 3
@@ -52,6 +54,8 @@ $ sudo apt-get install libglfw3-dev libepoxy-dev libjsoncpp-dev libgtk-3-dev \
5254
libx11-dev pkg-config
5355
```
5456

57+
**GN**
58+
5559
You will need to install the build tools if you don't already have them:
5660
* [ninja](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages)
5761
* [gn](https://gn.googlesource.com/gn/)
@@ -75,9 +79,11 @@ Public headers will be in `out/include/`; you should point dependent
7579
builds at that location rather than the `include/` directories in the
7680
source tree.
7781

78-
See
79-
[flutter_window_controller.h](include/flutter_desktop_embedding/glfw/flutter_window_controller.h)
80-
for details on calling into the library.
82+
The shared library provides a minimal C interface, but the recommended
83+
approach is to add the code in `out/fde_cpp_library/` to your project, to
84+
interact with the library using richer APIs. See
85+
[flutter_window_controller.h](/library/common/client_wrapper/include/flutter_desktop_embedding/glfw/flutter_window_controller.h)
86+
and the other headers under that directory for details.
8187

8288
### macOS
8389

@@ -107,6 +113,8 @@ so you do not need to include that framework in your project directly.
107113

108114
#### Dependencies
109115

116+
**Visual Studio**
117+
110118
You must have a copy of Visual Studio installed, and the command line build
111119
tools, such as `vcvars64.bat`, must be in your path. They are found under:
112120

@@ -120,17 +128,45 @@ e.g.:
120128
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
121129
```
122130

131+
**jsoncpp**
132+
133+
jsoncpp must be downloaded to `third_party/jsoncpp\src`. You can use
134+
`tools/dart_tools/bin/fetch_jsoncpp.dart` to simplify this:
135+
136+
```
137+
> tools\run_dart_tool.bat fetch_jsoncpp third_party\jsoncpp\src
138+
```
139+
140+
**GN**
141+
142+
You will need to install the build tools if you don't already have them:
143+
* [ninja](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages)
144+
* [GN](https://gn.googlesource.com/gn/)
145+
146+
Ensure that both binaries are in your path.
147+
123148
#### Using the Library
124149

125-
Build the GLFW Library project under `windows/` in Visual Studio into a static
126-
or dynamic library, then link `flutter_embedder.lib` into your binary and make
127-
sure `flutter_window_controller.h` is in your include paths. Also ensure that
128-
the `flutter_engine.dll`, and if using a dynamic library
129-
`flutter_embedder.dll`, are in valid DLL include paths.
150+
To build the library, run the following at the root of this repository:
151+
152+
```
153+
$ tools\gn_dart gen out
154+
$ ninja -C out flutter_embedder
155+
```
156+
Subsequent builds only require the `ninja` step, as the build will automatically
157+
re-run GN generation if necessary.
130158

131-
The output files are located in `bin\x64\$(Configuration)\GLFW Library\`.
159+
The build results will be in the top-level `out\` directory. You will need to
160+
link `libflutter_embedder.dll` and `libflutter_engine.dll` into your binary.
161+
Public headers will be in `out/include/`; you should point dependent
162+
builds at that location rather than the `include/` directories in the
163+
source tree.
132164

133-
_Note: There is also a [GN build](GN.md) available as an alternative._
165+
The DLL provides a minimal C interface, but the recommended
166+
approach is to add the code in `out\fde_cpp_library\` to your project, to
167+
interact with the library using richer APIs. See
168+
[flutter_window_controller.h](/library/common/client_wrapper/include/flutter_desktop_embedding/glfw/flutter_window_controller.h)
169+
and the other headers under that directory for details.
134170

135171
## Caveats
136172

0 commit comments

Comments
 (0)