summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt7
-rw-r--r--Depends-Android.cmake31
-rw-r--r--Depends.cmake5
-rw-r--r--src/main.c4
4 files changed, 45 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 18789f9c..22fe36f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -285,7 +285,12 @@ else ()
285endif () 285endif ()
286 286
287# Target. 287# Target.
288add_executable (app ${SOURCES} ${RESOURCES}) 288if (NOT ANDROID)
289 add_executable (app ${SOURCES} ${RESOURCES})
290else ()
291 # The whole app becomes one shared library, based on this static one.
292 add_library (app STATIC ${SOURCES})
293endif ()
289set_property (TARGET app PROPERTY C_STANDARD 11) 294set_property (TARGET app PROPERTY C_STANDARD 11)
290if (TARGET ext-deps) 295if (TARGET ext-deps)
291 add_dependencies (app ext-deps) 296 add_dependencies (app ext-deps)
diff --git a/Depends-Android.cmake b/Depends-Android.cmake
new file mode 100644
index 00000000..74635620
--- /dev/null
+++ b/Depends-Android.cmake
@@ -0,0 +1,31 @@
1if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/the_Foundation/.git)
2 message (FATAL_ERROR "'lib/the_Foundation' Git submodule not found")
3endif ()
4
5# the_Foundation is checked out as a submodule, make sure it's up to date.
6find_package (Git)
7if (GIT_FOUND)
8 execute_process (
9 COMMAND ${GIT_EXECUTABLE} submodule update
10 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
11 OUTPUT_VARIABLE subout
12 OUTPUT_STRIP_TRAILING_WHITESPACE
13 )
14 if (subout)
15 message (FATAL_ERROR "'lib/the_Foundation' Git submodule has been updated, please re-run CMake.\n")
16 endif ()
17endif ()
18
19set (INSTALL_THE_FOUNDATION OFF)
20set (TFDN_STATIC_LIBRARY ON CACHE BOOL "")
21set (TFDN_ENABLE_INSTALL OFF CACHE BOOL "")
22set (TFDN_ENABLE_TESTS OFF CACHE BOOL "")
23set (TFDN_ENABLE_WEBREQUEST OFF CACHE BOOL "")
24add_subdirectory (lib/the_Foundation)
25add_library (the_Foundation::the_Foundation ALIAS the_Foundation)
26if (NOT OPENSSL_FOUND)
27 message (FATAL_ERROR "Lagrange requires OpenSSL for TLS. Please check if pkg-config can find 'openssl'.")
28endif ()
29if (NOT ZLIB_FOUND)
30 message (FATAL_ERROR "Lagrange requires zlib for reading compressed archives. Please check if pkg-config can find 'zlib'.")
31endif () \ No newline at end of file
diff --git a/Depends.cmake b/Depends.cmake
index ca01b6c5..246f3398 100644
--- a/Depends.cmake
+++ b/Depends.cmake
@@ -3,6 +3,11 @@ if (IOS)
3 return () 3 return ()
4endif () 4endif ()
5 5
6if (ANDROID)
7 include (Depends-Android.cmake)
8 return ()
9endif ()
10
6find_package (PkgConfig) 11find_package (PkgConfig)
7find_program (MESON_EXECUTABLE meson DOC "Meson build system") 12find_program (MESON_EXECUTABLE meson DOC "Meson build system")
8find_program (NINJA_EXECUTABLE ninja DOC "Ninja build tool") 13find_program (NINJA_EXECUTABLE ninja DOC "Ninja build tool")
diff --git a/src/main.c b/src/main.c
index 6e5e99e9..ad69c6df 100644
--- a/src/main.c
+++ b/src/main.c
@@ -67,9 +67,11 @@ int main(int argc, char **argv) {
67 "ECDHE-RSA-AES128-GCM-SHA256:" 67 "ECDHE-RSA-AES128-GCM-SHA256:"
68 "DHE-RSA-AES256-GCM-SHA384"); 68 "DHE-RSA-AES256-GCM-SHA384");
69 SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1"); 69 SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
70 SDL_SetHint(SDL_HINT_MAC_BACKGROUND_APP, "1");
70 SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, "1"); 71 SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, "1");
72#if SDL_VERSION_ATLEAST(2, 0, 8)
71 SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0"); 73 SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0");
72 SDL_SetHint(SDL_HINT_MAC_BACKGROUND_APP, "1"); 74#endif
73#if 0 75#if 0
74 SDL_SetHint(SDL_HINT_MOUSE_TOUCH_EVENTS, "1"); /* debugging! */ 76 SDL_SetHint(SDL_HINT_MOUSE_TOUCH_EVENTS, "1"); /* debugging! */
75#endif 77#endif