File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,9 @@ if(__BUILTIN_TRAP)
113
113
set (HAVE_NORETURN_BUILTIN_TRAP 1)
114
114
endif ()
115
115
116
- find_package (LibRT)
116
+ if (NOT CMAKE_SYSTEM_NAME STREQUAL Android)
117
+ find_package (LibRT)
118
+ endif ()
117
119
118
120
check_function_exists(_pthread_workqueue_init HAVE__PTHREAD_WORKQUEUE_INIT)
119
121
check_function_exists(getprogname HAVE_GETPROGNAME)
Original file line number Diff line number Diff line change @@ -88,6 +88,14 @@ function(add_unit_test name)
88
88
target_compile_options (${name} PRIVATE -fblocks)
89
89
target_compile_options (${name} PRIVATE -Wall -Wno-deprecated-declarations)
90
90
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 ()
91
99
target_link_libraries (${name}
92
100
PRIVATE
93
101
dispatch
You can’t perform that action at this time.
0 commit comments