diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-08-20 18:27:46 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-08-20 18:27:46 +0300 |
commit | b7fe868ef9eda18ab1a537e5b77c269d4f1fd1b8 (patch) | |
tree | 30f49f9b1fcf1fa055e29617b40139dd10e1cf23 /CMakeLists.txt | |
parent | e482b978ab37177a949fdeb7522e26672d440b0e (diff) |
Added build options to force phone/tablet mobile UI
These options are mostly useful on mobile platforms that are not iOS or Android, and for testing purposes.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 262bbcb9..ee9c14d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -44,6 +44,8 @@ option (ENABLE_HARFBUZZ_MINIMAL "Build the HarfBuzz library with minimal depende | |||
44 | option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON) | 44 | option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON) |
45 | option (ENABLE_IPC "Use IPC to communicate between running instances" ON) | 45 | option (ENABLE_IPC "Use IPC to communicate between running instances" ON) |
46 | option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) | 46 | option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) |
47 | option (ENABLE_MOBILE_PHONE "Use the phone mobile UI design instead of desktop UI" OFF) | ||
48 | option (ENABLE_MOBILE_TABLET "Use the tablet mobile UI design instead of desktop UI" OFF) | ||
47 | option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON) | 49 | option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON) |
48 | option (ENABLE_RELATIVE_EMBED "Resources should always be found via relative path" OFF) | 50 | option (ENABLE_RELATIVE_EMBED "Resources should always be found via relative path" OFF) |
49 | option (ENABLE_RESIZE_DRAW "Force window to redraw during resizing" ${DEFAULT_RESIZE_DRAW}) | 51 | option (ENABLE_RESIZE_DRAW "Force window to redraw during resizing" ${DEFAULT_RESIZE_DRAW}) |
@@ -279,6 +281,16 @@ if (MOBILE) | |||
279 | add_definitions (-DiPlatformMobile=1) | 281 | add_definitions (-DiPlatformMobile=1) |
280 | else () | 282 | else () |
281 | add_definitions (-DiPlatformDesktop=1) | 283 | add_definitions (-DiPlatformDesktop=1) |
284 | # Forced UI design. | ||
285 | if (ENABLE_MOBILE_PHONE OR ENABLE_MOBILE_TABLET) | ||
286 | add_definitions (-DiPlatformMobile=1) | ||
287 | endif () | ||
288 | if (ENABLE_MOBILE_PHONE) | ||
289 | add_definitions (-DiPlatformMobilePhone=1) | ||
290 | endif () | ||
291 | if (ENABLE_MOBILE_TABLET) | ||
292 | add_definitions (-DiPlatformMobileTablet=1) | ||
293 | endif () | ||
282 | endif () | 294 | endif () |
283 | 295 | ||
284 | # Target. | 296 | # Target. |
@@ -300,37 +312,37 @@ target_compile_options (app PUBLIC | |||
300 | -DSTB_VORBIS_NO_INTEGER_CONVERSION=1 | 312 | -DSTB_VORBIS_NO_INTEGER_CONVERSION=1 |
301 | ) | 313 | ) |
302 | target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}") | 314 | target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}") |
315 | if (ENABLE_CUSTOM_FRAME AND MSYS) | ||
316 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_CUSTOM_FRAME=1) | ||
317 | endif () | ||
318 | if (ENABLE_DOWNLOAD_EDIT) | ||
319 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_DOWNLOAD_EDIT=1) | ||
320 | endif () | ||
321 | if (ENABLE_IDLE_SLEEP) | ||
322 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_IDLE_SLEEP=1) | ||
323 | endif () | ||
303 | if (ENABLE_IPC) | 324 | if (ENABLE_IPC) |
304 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_IPC=1) | 325 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_IPC=1) |
305 | endif () | 326 | endif () |
306 | if (ENABLE_X11_SWRENDER) | ||
307 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_X11_SWRENDER=1) | ||
308 | endif () | ||
309 | if (ENABLE_KERNING) | 327 | if (ENABLE_KERNING) |
310 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1) | 328 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1) |
311 | endif () | 329 | endif () |
312 | if (ENABLE_WINDOWPOS_FIX) | ||
313 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WINDOWPOS_FIX=1) | ||
314 | endif () | ||
315 | if (ENABLE_MPG123 AND MPG123_FOUND) | 330 | if (ENABLE_MPG123 AND MPG123_FOUND) |
316 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_MPG123=1) | 331 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_MPG123=1) |
317 | target_link_libraries (app PUBLIC PkgConfig::MPG123) | 332 | target_link_libraries (app PUBLIC PkgConfig::MPG123) |
318 | endif () | 333 | endif () |
334 | if (ENABLE_RESIZE_DRAW) | ||
335 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_RESIZE_DRAW=1) | ||
336 | endif () | ||
319 | if (ENABLE_WEBP AND WEBP_FOUND) | 337 | if (ENABLE_WEBP AND WEBP_FOUND) |
320 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WEBP=1) | 338 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WEBP=1) |
321 | target_link_libraries (app PUBLIC PkgConfig::WEBP) | 339 | target_link_libraries (app PUBLIC PkgConfig::WEBP) |
322 | endif () | 340 | endif () |
323 | if (ENABLE_IDLE_SLEEP) | 341 | if (ENABLE_WINDOWPOS_FIX) |
324 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_IDLE_SLEEP=1) | 342 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WINDOWPOS_FIX=1) |
325 | endif () | ||
326 | if (ENABLE_DOWNLOAD_EDIT) | ||
327 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_DOWNLOAD_EDIT=1) | ||
328 | endif () | ||
329 | if (ENABLE_CUSTOM_FRAME AND MSYS) | ||
330 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_CUSTOM_FRAME=1) | ||
331 | endif () | 343 | endif () |
332 | if (ENABLE_RESIZE_DRAW) | 344 | if (ENABLE_X11_SWRENDER) |
333 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_RESIZE_DRAW=1) | 345 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_X11_SWRENDER=1) |
334 | endif () | 346 | endif () |
335 | target_link_libraries (app PUBLIC the_Foundation::the_Foundation) | 347 | target_link_libraries (app PUBLIC the_Foundation::the_Foundation) |
336 | target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) | 348 | target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) |