diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 71 |
1 files changed, 57 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d421fe2..1bb50791 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -18,22 +18,31 @@ | |||
18 | cmake_minimum_required (VERSION 3.9) | 18 | cmake_minimum_required (VERSION 3.9) |
19 | 19 | ||
20 | project (Lagrange | 20 | project (Lagrange |
21 | VERSION 1.9.5 | 21 | VERSION 1.10.0 |
22 | DESCRIPTION "A Beautiful Gemini Client" | 22 | DESCRIPTION "A Beautiful Gemini Client" |
23 | LANGUAGES C | 23 | LANGUAGES C |
24 | ) | 24 | ) |
25 | set (COPYRIGHT_YEAR 2022) | 25 | set (COPYRIGHT_YEAR 2022) |
26 | if (IOS) | 26 | if (IOS) |
27 | set (PROJECT_VERSION 1.7) | 27 | set (PROJECT_VERSION 1.10) |
28 | set (IOS_BUNDLE_VERSION 23) | 28 | set (IOS_BUNDLE_VERSION 9) |
29 | set (IOS_BUILD_DATE "2021-10-23") | 29 | set (IOS_BUILD_DATE "2022-01-01") |
30 | endif () | ||
31 | if (ANDROID) | ||
32 | set (PROJECT_VERSION 1.10) | ||
33 | set (ANDROID_BUILD_VERSION a3) # remember to update Gradle, AndroidManifest.xml | ||
34 | set (ANDROID_BUILD_DATE "2022-01-03") | ||
30 | endif () | 35 | endif () |
31 | 36 | ||
32 | # Defaults that depend on environment. | 37 | # Defaults that depend on environment. |
33 | set (DEFAULT_RESIZE_DRAW ON) | 38 | set (DEFAULT_RESIZE_DRAW ON) |
34 | if (HAIKU) | 39 | if (HAIKU OR ANDROID) |
35 | set (DEFAULT_RESIZE_DRAW OFF) | 40 | set (DEFAULT_RESIZE_DRAW OFF) |
36 | endif () | 41 | endif () |
42 | set (DEFAULT_IDLE_SLEEP OFF) | ||
43 | if (IOS) | ||
44 | set (DEFAULT_IDLE_SLEEP ON) | ||
45 | endif () | ||
37 | 46 | ||
38 | # Build configuration. | 47 | # Build configuration. |
39 | option (ENABLE_CUSTOM_FRAME "Draw a custom window frame (Windows)" OFF) | 48 | option (ENABLE_CUSTOM_FRAME "Draw a custom window frame (Windows)" OFF) |
@@ -42,7 +51,7 @@ option (ENABLE_FRIBIDI "Use the GNU FriBidi library for bidirectional t | |||
42 | option (ENABLE_FRIBIDI_BUILD "Build the GNU FriBidi library (if OFF, try pkg-config)" OFF) | 51 | option (ENABLE_FRIBIDI_BUILD "Build the GNU FriBidi library (if OFF, try pkg-config)" OFF) |
43 | option (ENABLE_HARFBUZZ "Use the HarfBuzz library to shape text" ON) | 52 | option (ENABLE_HARFBUZZ "Use the HarfBuzz library to shape text" ON) |
44 | option (ENABLE_HARFBUZZ_MINIMAL "Build the HarfBuzz library with minimal dependencies (if OFF, try pkg-config)" OFF) | 53 | option (ENABLE_HARFBUZZ_MINIMAL "Build the HarfBuzz library with minimal dependencies (if OFF, try pkg-config)" OFF) |
45 | option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON) | 54 | option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ${DEFAULT_IDLE_SLEEP}) |
46 | option (ENABLE_IPC "Use IPC to communicate between running instances" ON) | 55 | option (ENABLE_IPC "Use IPC to communicate between running instances" ON) |
47 | option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) | 56 | option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) |
48 | option (ENABLE_MAC_MENUS "Use native context menus (macOS)" ON) | 57 | option (ENABLE_MAC_MENUS "Use native context menus (macOS)" ON) |
@@ -66,11 +75,8 @@ include (Depends.cmake) | |||
66 | message (STATUS "Preparing resources...") | 75 | message (STATUS "Preparing resources...") |
67 | set (RESOURCES | 76 | set (RESOURCES |
68 | res/about/about.gmi | 77 | res/about/about.gmi |
69 | res/about/help.gmi | ||
70 | res/about/lagrange.gmi | 78 | res/about/lagrange.gmi |
71 | res/about/license.gmi | 79 | res/about/license.gmi |
72 | res/about/version.gmi | ||
73 | res/arg-help.txt | ||
74 | res/lang/cs.bin | 80 | res/lang/cs.bin |
75 | res/lang/de.bin | 81 | res/lang/de.bin |
76 | res/lang/en.bin | 82 | res/lang/en.bin |
@@ -99,12 +105,38 @@ set (RESOURCES | |||
99 | ) | 105 | ) |
100 | file (GLOB FONTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} res/fonts/*) | 106 | file (GLOB FONTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} res/fonts/*) |
101 | list (APPEND RESOURCES ${FONTS}) | 107 | list (APPEND RESOURCES ${FONTS}) |
108 | if (IOS) | ||
109 | list (APPEND RESOURCES | ||
110 | res/about/ios-help.gmi | ||
111 | res/about/ios-version.gmi | ||
112 | ) | ||
113 | elseif (ANDROID) | ||
114 | list (APPEND RESOURCES | ||
115 | res/about/android-help.gmi | ||
116 | res/about/android-version.gmi | ||
117 | ) | ||
118 | else () | ||
119 | list (APPEND RESOURCES | ||
120 | res/about/help.gmi | ||
121 | res/about/version.gmi | ||
122 | res/arg-help.txt | ||
123 | ) | ||
124 | endif () | ||
102 | if ((UNIX AND NOT APPLE) OR MSYS) | 125 | if ((UNIX AND NOT APPLE) OR MSYS) |
103 | list (APPEND RESOURCES res/lagrange-64.png) | 126 | list (APPEND RESOURCES res/lagrange-64.png) |
104 | endif () | 127 | endif () |
105 | set (EMB_BIN ${CMAKE_CURRENT_BINARY_DIR}/resources.lgr) | 128 | set (EMB_BIN ${CMAKE_CURRENT_BINARY_DIR}/resources.lgr) |
106 | make_resources (${EMB_BIN} ${RESOURCES}) | 129 | make_resources (${EMB_BIN} ${RESOURCES}) |
107 | set_source_files_properties (${EMB_BIN} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) | 130 | set_source_files_properties (${EMB_BIN} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) |
131 | if (IOS) | ||
132 | set (EMB_FONTS | ||
133 | res/fonts/SourceSans3-Regular.ttf | ||
134 | res/fonts/IosevkaTerm-Extended.ttf | ||
135 | ) | ||
136 | set_source_files_properties (${EMB_FONTS} | ||
137 | PROPERTIES MACOSX_PACKAGE_LOCATION Resources | ||
138 | ) | ||
139 | endif () | ||
108 | 140 | ||
109 | # Source files. | 141 | # Source files. |
110 | set (SOURCES | 142 | set (SOURCES |
@@ -169,6 +201,8 @@ set (SOURCES | |||
169 | src/ui/bindingswidget.h | 201 | src/ui/bindingswidget.h |
170 | src/ui/certimportwidget.c | 202 | src/ui/certimportwidget.c |
171 | src/ui/certimportwidget.h | 203 | src/ui/certimportwidget.h |
204 | src/ui/certlistwidget.c | ||
205 | src/ui/certlistwidget.h | ||
172 | src/ui/color.c | 206 | src/ui/color.c |
173 | src/ui/color.h | 207 | src/ui/color.h |
174 | src/ui/command.c | 208 | src/ui/command.c |
@@ -177,6 +211,8 @@ set (SOURCES | |||
177 | src/ui/documentwidget.h | 211 | src/ui/documentwidget.h |
178 | src/ui/indicatorwidget.c | 212 | src/ui/indicatorwidget.c |
179 | src/ui/indicatorwidget.h | 213 | src/ui/indicatorwidget.h |
214 | src/ui/linkinfo.c | ||
215 | src/ui/linkinfo.h | ||
180 | src/ui/listwidget.c | 216 | src/ui/listwidget.c |
181 | src/ui/listwidget.h | 217 | src/ui/listwidget.h |
182 | src/ui/lookupwidget.c | 218 | src/ui/lookupwidget.c |
@@ -226,7 +262,7 @@ set (SOURCES | |||
226 | res/about/version.gmi | 262 | res/about/version.gmi |
227 | ${EMB_BIN} | 263 | ${EMB_BIN} |
228 | ) | 264 | ) |
229 | if (NOT APPLE) # macos.m has Sparkle updater | 265 | if (IOS OR NOT APPLE) # macos.m has Sparkle updater |
230 | list (APPEND SOURCES src/updater.c) | 266 | list (APPEND SOURCES src/updater.c) |
231 | endif () | 267 | endif () |
232 | if (ENABLE_IPC) | 268 | if (ENABLE_IPC) |
@@ -265,7 +301,7 @@ if (MSYS) | |||
265 | configure_file (res/lagrange.rc.in ${CMAKE_CURRENT_BINARY_DIR}/lagrange.rc NEWLINE_STYLE WIN32) | 301 | configure_file (res/lagrange.rc.in ${CMAKE_CURRENT_BINARY_DIR}/lagrange.rc NEWLINE_STYLE WIN32) |
266 | list (APPEND SOURCES src/win32.c src/win32.h ${CMAKE_CURRENT_BINARY_DIR}/lagrange.rc) | 302 | list (APPEND SOURCES src/win32.c src/win32.h ${CMAKE_CURRENT_BINARY_DIR}/lagrange.rc) |
267 | endif () | 303 | endif () |
268 | set_source_files_properties (${RESOURCES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) | 304 | #set_source_files_properties (${RESOURCES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) |
269 | if (MSYS OR (APPLE AND NOT MOBILE) OR (UNIX AND NOT MOBILE)) | 305 | if (MSYS OR (APPLE AND NOT MOBILE) OR (UNIX AND NOT MOBILE)) |
270 | add_definitions (-DiPlatformPcDesktop=1) | 306 | add_definitions (-DiPlatformPcDesktop=1) |
271 | endif () | 307 | endif () |
@@ -287,10 +323,10 @@ endif () | |||
287 | 323 | ||
288 | # Target. | 324 | # Target. |
289 | if (NOT ANDROID) | 325 | if (NOT ANDROID) |
290 | add_executable (app ${SOURCES} ${RESOURCES}) | 326 | add_executable (app ${SOURCES} ${RESOURCES} ${EMB_FONTS}) |
291 | else () | 327 | else () |
292 | # The whole app becomes one shared library, based on this static one. | 328 | # The whole app becomes one shared library, based on this static one. |
293 | add_library (app STATIC ${SOURCES}) | 329 | add_library (app SHARED ${SOURCES}) |
294 | endif () | 330 | endif () |
295 | set_property (TARGET app PROPERTY C_STANDARD 11) | 331 | set_property (TARGET app PROPERTY C_STANDARD 11) |
296 | if (TARGET ext-deps) | 332 | if (TARGET ext-deps) |
@@ -305,6 +341,7 @@ target_include_directories (app PUBLIC | |||
305 | target_compile_options (app PUBLIC | 341 | target_compile_options (app PUBLIC |
306 | -Werror=implicit-function-declaration | 342 | -Werror=implicit-function-declaration |
307 | -Werror=incompatible-pointer-types | 343 | -Werror=incompatible-pointer-types |
344 | -Wno-deprecated-declarations | ||
308 | ${SDL2_CFLAGS} | 345 | ${SDL2_CFLAGS} |
309 | -DSTB_VORBIS_NO_STDIO=1 | 346 | -DSTB_VORBIS_NO_STDIO=1 |
310 | -DSTB_VORBIS_NO_INTEGER_CONVERSION=1 | 347 | -DSTB_VORBIS_NO_INTEGER_CONVERSION=1 |
@@ -418,6 +455,12 @@ if (APPLE) | |||
418 | ) | 455 | ) |
419 | endif () | 456 | endif () |
420 | endif () | 457 | endif () |
458 | if (ANDROID) | ||
459 | target_compile_definitions (app PUBLIC | ||
460 | LAGRANGE_ANDROID_VERSION="${ANDROID_BUILD_VERSION}" | ||
461 | LAGRANGE_ANDROID_BUILD_DATE="${ANDROID_BUILD_DATE}" | ||
462 | ) | ||
463 | endif () | ||
421 | if (MSYS) | 464 | if (MSYS) |
422 | target_link_libraries (app PUBLIC d2d1 uuid dwmapi) # querying DPI | 465 | target_link_libraries (app PUBLIC d2d1 uuid dwmapi) # querying DPI |
423 | if (ENABLE_WINSPARKLE) | 466 | if (ENABLE_WINSPARKLE) |
@@ -452,7 +495,7 @@ elseif (HAIKU) | |||
452 | LAGRANGE_EMB_BIN="${CMAKE_INSTALL_PREFIX}/resources.lgr") | 495 | LAGRANGE_EMB_BIN="${CMAKE_INSTALL_PREFIX}/resources.lgr") |
453 | install (FILES ${EMB_BIN} DESTINATION .) | 496 | install (FILES ${EMB_BIN} DESTINATION .) |
454 | elseif (ANDROID) | 497 | elseif (ANDROID) |
455 | file (COPY ${EMB_BIN} DESTINATION ${CMAKE_SOURCE_DIR}/../app/src/main/assets) | 498 | file (COPY ${EMB_BIN} DESTINATION ${CMAKE_SOURCE_DIR}/../src/main/assets) |
456 | elseif (UNIX AND NOT APPLE) | 499 | elseif (UNIX AND NOT APPLE) |
457 | include (GNUInstallDirs) | 500 | include (GNUInstallDirs) |
458 | set_target_properties (app PROPERTIES | 501 | set_target_properties (app PROPERTIES |