summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-08-20 18:27:46 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-08-20 18:27:46 +0300
commitb7fe868ef9eda18ab1a537e5b77c269d4f1fd1b8 (patch)
tree30f49f9b1fcf1fa055e29617b40139dd10e1cf23 /CMakeLists.txt
parente482b978ab37177a949fdeb7522e26672d440b0e (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.txt44
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
44option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON) 44option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON)
45option (ENABLE_IPC "Use IPC to communicate between running instances" ON) 45option (ENABLE_IPC "Use IPC to communicate between running instances" ON)
46option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) 46option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON)
47option (ENABLE_MOBILE_PHONE "Use the phone mobile UI design instead of desktop UI" OFF)
48option (ENABLE_MOBILE_TABLET "Use the tablet mobile UI design instead of desktop UI" OFF)
47option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON) 49option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON)
48option (ENABLE_RELATIVE_EMBED "Resources should always be found via relative path" OFF) 50option (ENABLE_RELATIVE_EMBED "Resources should always be found via relative path" OFF)
49option (ENABLE_RESIZE_DRAW "Force window to redraw during resizing" ${DEFAULT_RESIZE_DRAW}) 51option (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)
280else () 282else ()
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 ()
282endif () 294endif ()
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)
302target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}") 314target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}")
315if (ENABLE_CUSTOM_FRAME AND MSYS)
316 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_CUSTOM_FRAME=1)
317endif ()
318if (ENABLE_DOWNLOAD_EDIT)
319 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_DOWNLOAD_EDIT=1)
320endif ()
321if (ENABLE_IDLE_SLEEP)
322 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_IDLE_SLEEP=1)
323endif ()
303if (ENABLE_IPC) 324if (ENABLE_IPC)
304 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_IPC=1) 325 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_IPC=1)
305endif () 326endif ()
306if (ENABLE_X11_SWRENDER)
307 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_X11_SWRENDER=1)
308endif ()
309if (ENABLE_KERNING) 327if (ENABLE_KERNING)
310 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1) 328 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1)
311endif () 329endif ()
312if (ENABLE_WINDOWPOS_FIX)
313 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WINDOWPOS_FIX=1)
314endif ()
315if (ENABLE_MPG123 AND MPG123_FOUND) 330if (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)
318endif () 333endif ()
334if (ENABLE_RESIZE_DRAW)
335 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_RESIZE_DRAW=1)
336endif ()
319if (ENABLE_WEBP AND WEBP_FOUND) 337if (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)
322endif () 340endif ()
323if (ENABLE_IDLE_SLEEP) 341if (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)
325endif ()
326if (ENABLE_DOWNLOAD_EDIT)
327 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_DOWNLOAD_EDIT=1)
328endif ()
329if (ENABLE_CUSTOM_FRAME AND MSYS)
330 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_CUSTOM_FRAME=1)
331endif () 343endif ()
332if (ENABLE_RESIZE_DRAW) 344if (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)
334endif () 346endif ()
335target_link_libraries (app PUBLIC the_Foundation::the_Foundation) 347target_link_libraries (app PUBLIC the_Foundation::the_Foundation)
336target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) 348target_link_libraries (app PUBLIC ${SDL2_LDFLAGS})