@@ -37,6 +37,8 @@ the ICU data from the Flutter engine.
37
37
38
38
#### Dependencies
39
39
40
+ ** Libraries**
41
+
40
42
First you will need to install the relevant library dependencies:
41
43
* GLFW3
42
44
* GTK 3
@@ -52,6 +54,8 @@ $ sudo apt-get install libglfw3-dev libepoxy-dev libjsoncpp-dev libgtk-3-dev \
52
54
libx11-dev pkg-config
53
55
```
54
56
57
+ ** GN**
58
+
55
59
You will need to install the build tools if you don't already have them:
56
60
* [ ninja] ( https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages )
57
61
* [ gn] ( https://gn.googlesource.com/gn/ )
@@ -75,9 +79,11 @@ Public headers will be in `out/include/`; you should point dependent
75
79
builds at that location rather than the ` include/ ` directories in the
76
80
source tree.
77
81
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.
81
87
82
88
### macOS
83
89
@@ -107,6 +113,8 @@ so you do not need to include that framework in your project directly.
107
113
108
114
#### Dependencies
109
115
116
+ ** Visual Studio**
117
+
110
118
You must have a copy of Visual Studio installed, and the command line build
111
119
tools, such as ` vcvars64.bat ` , must be in your path. They are found under:
112
120
@@ -120,17 +128,45 @@ e.g.:
120
128
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
121
129
```
122
130
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
+
123
148
#### Using the Library
124
149
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.
130
158
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.
132
164
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.
134
170
135
171
## Caveats
136
172
0 commit comments