@@ -19,7 +19,7 @@ path to it should be specified using the GDLPP environment variable
1919naming may be needed.) or placed in the same folder as grcompiler.
2020
2121- GrcRegressionTest is used to regression test grcompiler against a set of
22- reference GDL files and fonts. The regression tests are typically ran using
22+ reference GDL files and fonts. The regression tests are typically ran using
2323project files (see below).
2424
2525### GDLPP #include details
@@ -134,20 +134,20 @@ You will need libc++ and libc++-abi packages.
134134
135135#### Windows specific details
136136
137- Visual Studio 2017 added support for handling CMake projects. You can find
137+ Visual Studio 2017 added support for handling CMake projects. You can find
138138more information and instructions at
139139[CMake projects in Visual Studio](https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=vs-2019).
140140
141- TIPS:
142- - After generating the project files and optionally doing inital building and
143- testing (above), the easiest way for Visual Studio developers to proceed is to
141+ TIPS:
142+ - After generating the project files and optionally doing inital building and
143+ testing (above), the easiest way for Visual Studio developers to proceed is to
144144open the `grcompiler.sln` file that cmake generates.
145145
146- - The Solution Explorer will contain projects for `grcompiler`, `gdlpp`, and
147- `GrcRegressionTest`, as well as several other projects, some of which are just
146+ - The Solution Explorer will contain projects for `grcompiler`, `gdlpp`, and
147+ `GrcRegressionTest`, as well as several other projects, some of which are just
148148empty standard test targets that cmake generates.
149149
150- - Do NOT switch the Solution Explorer to Folder View as that will cause cmake
150+ - Do NOT switch the Solution Explorer to Folder View as that will cause cmake
151151project generation to be redone using the Ninja generator (see below).
152152
153153- Right clicking on the grcompiler project and setting it as the Startup
@@ -158,7 +158,7 @@ Project is advisable.
158158- Right clicking on RUN_TESTS and Building will run the regression tests.
159159
160160If development with cmake is preferred, in Visual Studio 2019,`File-Open-CMake...`
161- can be used to open the CMakeCache.txt file. Using `File-Open Folder...' is not
161+ can be used to open the CMakeCache.txt file. Using `File-Open Folder...` is not
162162advisable, since the Ninja project generator will be used. It seems buggy.
163163FWIW, it's harder to specify the arguments to use for debugging with cmake
164164development compared to using the sln file.
@@ -177,57 +177,75 @@ The CMake approach above is strongly encouraged.
177177The choice of 32- or 64-bit build tools and targets is made by building
178178from the appropriate Visual Studio command prompt.
179179
180- To build grcomiler release binaries, from the `compiler` folder:
181- ```
182- nmake -f makefile.mak
183- ```
184-
185- To build grcompiler debug binaries:
186- ```
187- nmake CFG=DEBUG -f makefile.mak
188- ```
180+ To build grcomiler release binaries, from the `compiler` folder:
181+ ```
182+ nmake -f makefile.mak
183+ ```
189184
190- TIP: A debug build for ICU from source may be needed too (see below).
185+ To build grcompiler debug binaries:
186+ ```
187+ nmake CFG=DEBUG -f makefile.mak
188+ ```
191189
192- Cleaning up, to remove all .obj files without removing the binaries:
193- ```
194- nmake -f makefile.mak clean
195- ```
190+ TIP: A debug build for ICU from source will be needed too (see below).
196191
197- To remove the binaries as well:
198- ```
199- nmake -f makefile.mak realclean
200- ```
192+ Cleaning up, to remove all .obj files without removing the binaries:
193+ ```
194+ nmake -f makefile.mak clean
195+ ```
201196
197+ To remove the binaries as well:
198+ ```
199+ nmake -f makefile.mak realclean
200+ ```
202201This deletes the libraries as well.
203202
204- To build gdlpp, from the `preprocessor` folder:
205- ```
206- nmake -f gdlpp.mak
207- ```
203+ To build gdlpp, from the `preprocessor` folder:
204+ ```
205+ nmake -f gdlpp.mak
206+ ```
208207
209- To build GrcRegressionTest and run regression tests,
210- from the `test/GrcRegressionTest` folder:
211- `nmake -f Makefile.vc`
212- `cd fonts`
213- `nmake -f regtest.mak`
208+ To build GrcRegressionTest and run regression tests, from the
209+ `test/GrcRegressionTest` folder:
210+ ```
211+ nmake -f Makefile.vc
212+ cd fonts
213+ nmake -f regtest.mak
214+ ```
214215
215216To use Visual Studio, setup a new makefile project and add commands
216217for building, testing, and debugging using the makefiles indicated above.
217218
218219## DEPENDENCIES
219220### ICU
220221
222+ The grcompiler executable has a hard build dependency on ICU. This
223+ dependency may be satisfied via a system supplied dev package as is common on
224+ Linux, or via a pre-built binary distribution archive available from the
225+ [ICU4C project](http://site.icu-project.org/download/).
226+
227+ - CMake:
228+ This will automatically download and unpack any archive URL passed to it
229+ via `ICU_URL`. It will search for ICU includes and libraries in the root
230+ of that archive expecting to find `include`, `lib` and `bin` directories.
231+ If those dirs are deeper inside the archive (e.g. inside usr/local) then
232+ passing the relative archive path in `ICU_ROOT` will cause it to search
233+ there. If you have a local binary copy, e.g. if you are patching ICU too,
234+ you can have it use that instead by passing the path in
235+ `FETCHCONTENT_SOURCE_DIR_ICU`. Lastly passing just `ICU_ROOT` as a
236+ semi-colon separated list of paths to search allows you to use an ICU
237+ distribution where executables, includes and libraries aren't neatly
238+ arranged. This might be the case if you want to pass both debug and
239+ release builds of ICU on Windows, in which case it will link the
240+ appopriate version.
241+
221242#### Linux
222243
223244You should use your distributions package manager to install icu-dev package.
224245
225246- CMake:
226- It will automatically find the system dev package installed by you package
227- manager. Setting the CMake variable ICU_ROOT to an abolute path will
228- override this process and use the built copy located at the provided path.
229- This can be set by passing `-DICU_ROOT=<path to built ICU files>` to the
230- `cmake` configuration invocation.
247+ By default it will automatically find the system dev package installed by
248+ your package manager via the use of pkg-config.
231249- autotools:
232250 This will auto detect the icu installation via the use of pkg-config
233251 To overide the detection you need to provide compiler and linker flags via
@@ -236,34 +254,20 @@ You should use your distributions package manager to install icu-dev package.
236254
237255#### Windows
238256
239- The Graphite compiler requires library modules from ICU.
240-
241- - CMake:
242- The CMakeLists.txt will automatically fetch the icu4c.v140 nuget package
243- for you and also a copy of nuget if it's not installed. Modify
244- `packages.config.in` to update the version. Setting the ICU_ROOT CMake
245- variable to the semicolon separated list of directories which contain the
246- `.lib` stub files for the ICU DLLS and the include directory allows you to
247- use the official pre-built ICU distribution. In addition you will need to
248- set ICU_REDIST_ROOT to the path where the DLLs are if you want testing to
249- work as the build script will need to copy them.
250- .e.g if you unzip the downloaded ICU distribution into a dir called `icu`
251- in the top of the source tree you would pass these to `cmake`:
252- `-DICU_ROOT="..\icu\lib;..\icu\include"` and
253- `-DICU_REDIST_ROOT="..\icu\bin"` in addition to the usual arguments.
254- - Nmake:
255- You will need to download the ICU binaries from the following web
256- site: http://site.icu-project.org/download/
257- - Create an icu folder under this project's top level folder and unzip
257+ - CMake:
258+ If no `ICU_URL`, `FETCHCONTENT_SOURCE_DIR_ICU` or `ICU_ROOT` parameter is
259+ passed then it will automatically set `ICU_URL` to a recent release and
260+ proceed as above, by downloading and using that archive.
261+ - Nmake:
262+ - Create an icu folder under this project's top level folder and unzip
258263 the archive into it.
259- - makefile.mak copies the needed binaries to the folder where grcompiler
264+ - makefile.mak copies the needed binaries to the folder where grcompiler
260265 is built. You may need to modify the file names for the icu/bin/*.dll
261266 files in makefile.mak since the file names include the version number
262267 of icu.
263- - The icu project only supplies release versions of the binaries. So, when
268+ - The icu project only supplies release versions of the binaries. So, when
264269 building a debug version of grcompiler, it is linked to release versions
265270 of the ICU dlls. To link to debug versions instead, icu binaries have to be
266271 built from source and makefile.mak adjusted to use them. In the icu source,
267272 there is a VisualStudio file in the source\allinone directory that can be
268273 used to build the binaries. The "common" project is the one to build.
269- Good luck!
0 commit comments