diff options
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | Depends-Android.cmake | 31 | ||||
-rw-r--r-- | Depends.cmake | 5 | ||||
-rw-r--r-- | src/main.c | 4 |
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 () | |||
285 | endif () | 285 | endif () |
286 | 286 | ||
287 | # Target. | 287 | # Target. |
288 | add_executable (app ${SOURCES} ${RESOURCES}) | 288 | if (NOT ANDROID) |
289 | add_executable (app ${SOURCES} ${RESOURCES}) | ||
290 | else () | ||
291 | # The whole app becomes one shared library, based on this static one. | ||
292 | add_library (app STATIC ${SOURCES}) | ||
293 | endif () | ||
289 | set_property (TARGET app PROPERTY C_STANDARD 11) | 294 | set_property (TARGET app PROPERTY C_STANDARD 11) |
290 | if (TARGET ext-deps) | 295 | if (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 @@ | |||
1 | if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/the_Foundation/.git) | ||
2 | message (FATAL_ERROR "'lib/the_Foundation' Git submodule not found") | ||
3 | endif () | ||
4 | |||
5 | # the_Foundation is checked out as a submodule, make sure it's up to date. | ||
6 | find_package (Git) | ||
7 | if (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 () | ||
17 | endif () | ||
18 | |||
19 | set (INSTALL_THE_FOUNDATION OFF) | ||
20 | set (TFDN_STATIC_LIBRARY ON CACHE BOOL "") | ||
21 | set (TFDN_ENABLE_INSTALL OFF CACHE BOOL "") | ||
22 | set (TFDN_ENABLE_TESTS OFF CACHE BOOL "") | ||
23 | set (TFDN_ENABLE_WEBREQUEST OFF CACHE BOOL "") | ||
24 | add_subdirectory (lib/the_Foundation) | ||
25 | add_library (the_Foundation::the_Foundation ALIAS the_Foundation) | ||
26 | if (NOT OPENSSL_FOUND) | ||
27 | message (FATAL_ERROR "Lagrange requires OpenSSL for TLS. Please check if pkg-config can find 'openssl'.") | ||
28 | endif () | ||
29 | if (NOT ZLIB_FOUND) | ||
30 | message (FATAL_ERROR "Lagrange requires zlib for reading compressed archives. Please check if pkg-config can find 'zlib'.") | ||
31 | endif () \ 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 () |
4 | endif () | 4 | endif () |
5 | 5 | ||
6 | if (ANDROID) | ||
7 | include (Depends-Android.cmake) | ||
8 | return () | ||
9 | endif () | ||
10 | |||
6 | find_package (PkgConfig) | 11 | find_package (PkgConfig) |
7 | find_program (MESON_EXECUTABLE meson DOC "Meson build system") | 12 | find_program (MESON_EXECUTABLE meson DOC "Meson build system") |
8 | find_program (NINJA_EXECUTABLE ninja DOC "Ninja build tool") | 13 | find_program (NINJA_EXECUTABLE ninja DOC "Ninja build tool") |
@@ -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 |