|
1 | 1 | # Android multi-backend build (Gradle `multiBackend` flavor only). |
2 | 2 | # |
3 | | -# Builds libmaplibre.so (OpenGL) and libmaplibre-vulkan.so (Vulkan) by invoking this directory's |
| 3 | +# Builds libmaplibre.so (Vulkan) and libmaplibre-opengl.so (OpenGL) by invoking this directory's |
4 | 4 | # stock single-backend build twice via ExternalProject, and surfaces both to AGP as SHARED |
5 | 5 | # targets so both .so land in the multiBackend AAR. |
6 | 6 | # |
@@ -58,18 +58,19 @@ ExternalProject_Add(maplibre-vulkan-build |
58 | 58 | set(_stub ${CMAKE_BINARY_DIR}/maplibre_multi_stub.cpp) |
59 | 59 | file(WRITE ${_stub} "extern \"C\" void maplibre_multi_backend_stub() {}\n") |
60 | 60 |
|
61 | | -add_library(maplibre-opengl SHARED ${_stub}) |
62 | | -# Produce libmaplibre.so (not libmaplibre-opengl.so) so the OpenGL output matches the |
63 | | -# single-backend OpenGL AAR's library name. |
64 | | -set_target_properties(maplibre-opengl PROPERTIES OUTPUT_NAME maplibre) |
| 61 | +add_library(maplibre-opengl SHARED ${_stub}) # -> libmaplibre-opengl.so |
65 | 62 | add_dependencies(maplibre-opengl maplibre-opengl-build) |
66 | 63 | add_custom_command(TARGET maplibre-opengl POST_BUILD |
67 | 64 | COMMAND ${CMAKE_COMMAND} -E copy |
68 | 65 | ${_gl}/lib/libmaplibre.so |
69 | 66 | $<TARGET_FILE:maplibre-opengl> |
70 | 67 | VERBATIM) |
71 | 68 |
|
72 | | -add_library(maplibre-vulkan SHARED ${_stub}) # -> libmaplibre-vulkan.so |
| 69 | +add_library(maplibre-vulkan SHARED ${_stub}) |
| 70 | +# Produce libmaplibre.so (not libmaplibre-vulkan.so): Vulkan is the multiBackend AAR's |
| 71 | +# default/primary library, matching the SDK-wide convention where Vulkan is the default |
| 72 | +# backend and OpenGL ships as the explicitly-named "-opengl" variant. |
| 73 | +set_target_properties(maplibre-vulkan PROPERTIES OUTPUT_NAME maplibre) |
73 | 74 | add_dependencies(maplibre-vulkan maplibre-vulkan-build) |
74 | 75 | add_custom_command(TARGET maplibre-vulkan POST_BUILD |
75 | 76 | COMMAND ${CMAKE_COMMAND} -E copy |
|
0 commit comments