Skip to content

Commit 8554adb

Browse files
committed
revert changes to libjpeg paths back to /usr/
based on PR feedback about this document being aimed at Linux
1 parent ba1a8cd commit 8554adb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Documentation/SystemModules.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ To `import CJPEG` the package manager requires
2424
that the JPEG library has been installed by a system packager (eg. `apt`, `brew`, `yum`, etc.).
2525
The following files from the JPEG system-package are of interest:
2626

27-
/usr/local/lib/libjpeg.so # .dylib on OS X
28-
/usr/local/include/jpeglib.h
27+
/usr/lib/libjpeg.so # .dylib on OS X
28+
/usr/include/jpeglib.h
2929

3030
Swift packages that provide module maps for system libraries are handled differently from regular Swift packages.
3131

32+
Note that `brew` will install this package in `/usr/local/` rather than `/usr/`.
33+
3234
Create a directory called `CJPEG` parallel to the `example` directory and create a file called `module.modulemap`:
3335

3436
example$ cd ..
@@ -39,7 +41,7 @@ Create a directory called `CJPEG` parallel to the `example` directory and create
3941
Edit the `module.modulemap` so it consists of the following:
4042

4143
module CJPEG [system] {
42-
header "/usr/local/include/jpeglib.h"
44+
header "/usr/include/jpeglib.h"
4345
link "jpeg"
4446
export *
4547
}
@@ -180,9 +182,9 @@ And run it:
180182
Please note that on some platforms, the above steps fail with:
181183

182184
<module-includes>:1:10: note: in file included from <module-includes>:1:
183-
#include "/usr/local/include/jpeglib.h"
185+
#include "/usr/include/jpeglib.h"
184186
^
185-
/usr/local/include/jpeglib.h:792:3: error: unknown type name 'size_t'
187+
/usr/include/jpeglib.h:792:3: error: unknown type name 'size_t'
186188
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
187189
^
188190

0 commit comments

Comments
 (0)