summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--Depends.cmake22
2 files changed, 26 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b62517c9..2621dc10 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,7 @@ endif ()
30 30
31# Build configuration. 31# Build configuration.
32option (ENABLE_HARFBUZZ "Use HarfBuzz to shape text" ON) 32option (ENABLE_HARFBUZZ "Use HarfBuzz to shape text" ON)
33option (ENABLE_FRIBIDI "Use FriBidi for bidirectional text" ON)
33option (ENABLE_IPC "Use IPC to communicate between running instances" ON) 34option (ENABLE_IPC "Use IPC to communicate between running instances" ON)
34option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON) 35option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON)
35option (ENABLE_X11_SWRENDER "Use software rendering under X11" OFF) 36option (ENABLE_X11_SWRENDER "Use software rendering under X11" OFF)
@@ -319,6 +320,10 @@ if (ENABLE_HARFBUZZ AND HARFBUZZ_FOUND)
319 endif () 320 endif ()
320 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_HARFBUZZ=1) 321 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_HARFBUZZ=1)
321endif () 322endif ()
323if (ENABLE_FRIBIDI AND FRIBIDI_FOUND)
324 target_link_libraries (app PUBLIC fribidi-lib)
325 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_FRIBIDI=1)
326endif ()
322if (APPLE) 327if (APPLE)
323 if (IOS) 328 if (IOS)
324 target_link_libraries (app PUBLIC "-framework UIKit") 329 target_link_libraries (app PUBLIC "-framework UIKit")
diff --git a/Depends.cmake b/Depends.cmake
index f543f576..002022ed 100644
--- a/Depends.cmake
+++ b/Depends.cmake
@@ -3,7 +3,7 @@ if (IOS)
3 return () 3 return ()
4endif () 4endif ()
5 5
6if (ENABLE_HARFBUZZ AND EXISTS ${CMAKE_SOURCE_DIR}/lib/harfbuzz) 6if (ENABLE_HARFBUZZ AND EXISTS ${CMAKE_SOURCE_DIR}/lib/harfbuzz/CMakeLists.txt)
7 # Build HarfBuzz with minimal dependencies. 7 # Build HarfBuzz with minimal dependencies.
8 set (HB_BUILD_SUBSET OFF CACHE BOOL "" FORCE) 8 set (HB_BUILD_SUBSET OFF CACHE BOOL "" FORCE)
9 set (HB_HAVE_CORETEXT OFF CACHE BOOL "" FORCE) 9 set (HB_HAVE_CORETEXT OFF CACHE BOOL "" FORCE)
@@ -11,10 +11,30 @@ if (ENABLE_HARFBUZZ AND EXISTS ${CMAKE_SOURCE_DIR}/lib/harfbuzz)
11 set (HB_HAVE_GLIB OFF CACHE BOOL "" FORCE) 11 set (HB_HAVE_GLIB OFF CACHE BOOL "" FORCE)
12 set (HB_HAVE_GOBJECT OFF CACHE BOOL "" FORCE) 12 set (HB_HAVE_GOBJECT OFF CACHE BOOL "" FORCE)
13 set (HB_HAVE_ICU OFF CACHE BOOL "" FORCE) 13 set (HB_HAVE_ICU OFF CACHE BOOL "" FORCE)
14 cmake_policy (SET CMP0075 NEW)
14 add_subdirectory (${CMAKE_SOURCE_DIR}/lib/harfbuzz) 15 add_subdirectory (${CMAKE_SOURCE_DIR}/lib/harfbuzz)
15 set (HARFBUZZ_FOUND YES) 16 set (HARFBUZZ_FOUND YES)
16endif () 17endif ()
17 18
19if (ENABLE_FRIBIDI AND EXISTS ${CMAKE_SOURCE_DIR}/lib/fribidi)
20 # Build FriBidi with Meson.
21 include (ExternalProject)
22 set (_dst ${CMAKE_BINARY_DIR}/lib/fribidi)
23 ExternalProject_Add (fribidi
24 PREFIX ${CMAKE_BINARY_DIR}/fribidi-ext
25 SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/fribidi
26 CONFIGURE_COMMAND meson ${CMAKE_SOURCE_DIR}/lib/fribidi
27 -Dtests=false -Ddocs=false -Dbin=false
28 --prefix ${_dst}
29 BUILD_COMMAND ninja
30 INSTALL_COMMAND ninja install
31 )
32 add_library (fribidi-lib INTERFACE)
33 target_include_directories (fribidi-lib INTERFACE ${_dst}/include)
34 target_link_libraries (fribidi-lib INTERFACE -L${_dst}/lib fribidi)
35 set (FRIBIDI_FOUND YES)
36endif ()
37
18if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt) 38if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt)
19 set (INSTALL_THE_FOUNDATION YES) 39 set (INSTALL_THE_FOUNDATION YES)
20 find_package (the_Foundation REQUIRED) 40 find_package (the_Foundation REQUIRED)