@@ -24,11 +24,13 @@ To `import CJPEG` the package manager requires
24
24
that the JPEG library has been installed by a system packager (eg. ` apt ` , ` brew ` , ` yum ` , etc.).
25
25
The following files from the JPEG system-package are of interest:
26
26
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
29
29
30
30
Swift packages that provide module maps for system libraries are handled differently from regular Swift packages.
31
31
32
+ Note that ` brew ` will install this package in ` /usr/local/ ` rather than ` /usr/ ` .
33
+
32
34
Create a directory called ` CJPEG ` parallel to the ` example ` directory and create a file called ` module.modulemap ` :
33
35
34
36
example$ cd ..
@@ -39,7 +41,7 @@ Create a directory called `CJPEG` parallel to the `example` directory and create
39
41
Edit the ` module.modulemap ` so it consists of the following:
40
42
41
43
module CJPEG [system] {
42
- header "/usr/local/ include/jpeglib.h"
44
+ header "/usr/include/jpeglib.h"
43
45
link "jpeg"
44
46
export *
45
47
}
@@ -180,9 +182,9 @@ And run it:
180
182
Please note that on some platforms, the above steps fail with:
181
183
182
184
<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"
184
186
^
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'
186
188
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
187
189
^
188
190
0 commit comments