Skip to content

Commit f74ff80

Browse files
committed
Compile a static libtermux-api as well
And link termux-api-broadcast against the static one to speed it up a bit. Suggested-by: @agnostic-apollo
1 parent 0fd5e31 commit f74ff80

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ include(GNUInstallDirs)
55
set(TERMUX_PREFIX ${CMAKE_INSTALL_PREFIX})
66

77
add_library(termux-api SHARED termux-api.c)
8+
add_library(termux-api-static STATIC termux-api.c)
9+
set_target_properties(termux-api-static PROPERTIES OUTPUT_NAME termux-api)
810

911
add_executable(termux-api-broadcast termux-api-broadcast.c)
10-
target_link_libraries(termux-api-broadcast termux-api)
12+
target_link_libraries(termux-api-broadcast termux-api-static)
1113

1214
# TODO: get list through regex or similar
1315
set(script_files
@@ -101,7 +103,9 @@ INSTALL(CODE "execute_process( \
101103
)
102104

103105
install(
104-
FILES ${CMAKE_BINARY_DIR}/libtermux-api.so
106+
FILES
107+
${CMAKE_BINARY_DIR}/libtermux-api.so
108+
${CMAKE_BINARY_DIR}/libtermux-api.a
105109
TYPE LIB
106110
)
107111

0 commit comments

Comments
 (0)