freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 7252e35: [meson] Fix 'mmap' handling on Windows.


From: Werner Lemberg
Subject: [freetype2] master 7252e35: [meson] Fix 'mmap' handling on Windows.
Date: Mon, 8 Mar 2021 04:25:13 -0500 (EST)

branch: master
commit 7252e35ed250000a50537176ba74070a9c3b5404
Author: Tim-Philipp Müller <tim@centricular.com>
Commit: Werner Lemberg <wl@gnu.org>

    [meson] Fix 'mmap' handling on Windows.
    
    * meson.build (ft2_sources): Always use `windows/ftsystem.c` on
    Windows unless mmap has been disabled.
    
      
https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/5#note_829289
---
 ChangeLog   |  9 +++++++++
 meson.build | 20 +++++++++++---------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6e90f40..a902e41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2021-03-08  Tim-Philipp Müller  <tim@centricular.com>
+
+       [meson] Fix 'mmap' handling on Windows.
+
+       * meson.build (ft2_sources): Always use `windows/ftsystem.c` on
+       Windows unless mmap has been disabled.
+
+         
https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/5#note_829289
+
 2021-03-07  Tim-Philipp Müller  <tim@centricular.com>
 
        [ci] Add basic support for Meson builds with MSVC on Windows.
diff --git a/meson.build b/meson.build
index c398456..816c478 100644
--- a/meson.build
+++ b/meson.build
@@ -183,18 +183,20 @@ has_fcntl_h = cc.has_header('fcntl.h')
 has_sys_mman_h = cc.has_header('sys/mman.h')
 
 mmap_option = get_option('mmap')
-if mmap_option.auto()
-  use_mmap = has_unistd_h and has_fcntl_h and has_sys_mman_h
-else
-  use_mmap = mmap_option.enabled()
-endif
-if use_mmap
-  # This version of ftsystem.c uses mmap() to read input font files.
-  ft2_sources += files(['builds/unix/ftsystem.c',])
+if mmap_option.disabled()
+  ft2_sources += files(['src/base/ftsystem.c',])
 elif host_machine.system() == 'windows'
   ft2_sources += files(['builds/windows/ftsystem.c',])
 else
-  ft2_sources += files(['src/base/ftsystem.c',])
+  if has_unistd_h and has_fcntl_h and has_sys_mman_h
+    # This version of ftsystem.c uses mmap() to read input font files.
+    ft2_sources += files(['builds/unix/ftsystem.c',])
+  elif mmap_option.enabled()
+    error('mmap was enabled via options but is not available,'
+          + ' required headers were not found!')
+  else
+    ft2_sources += files(['src/base/ftsystem.c',])
+  endif
 endif
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]