File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,9 @@ if(__BUILTIN_TRAP)
113113 set (HAVE_NORETURN_BUILTIN_TRAP 1)
114114endif ()
115115
116- find_package (LibRT)
116+ if (NOT CMAKE_SYSTEM_NAME STREQUAL Android)
117+ find_package (LibRT)
118+ endif ()
117119
118120check_function_exists(_pthread_workqueue_init HAVE__PTHREAD_WORKQUEUE_INIT)
119121check_function_exists(getprogname HAVE_GETPROGNAME)
Original file line number Diff line number Diff line change @@ -88,6 +88,14 @@ function(add_unit_test name)
8888 target_compile_options (${name} PRIVATE -fblocks)
8989 target_compile_options (${name} PRIVATE -Wall -Wno-deprecated-declarations)
9090 endif ()
91+ # Without this flag, cross-compiling static test executables for Android armv7
92+ # fails with the multiple definition errors seen in android/ndk#176, so I
93+ # pulled in this workaround noted there. The tests build and run with this
94+ # flag applied.
95+ if (NOT BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL Android AND
96+ CMAKE_SYSTEM_PROCESSOR STREQUAL armv7-a)
97+ target_link_options (${name} PRIVATE "LINKER:--allow-multiple-definition" )
98+ endif ()
9199 target_link_libraries (${name}
92100 PRIVATE
93101 dispatch
You can’t perform that action at this time.
0 commit comments