@@ -77,7 +77,11 @@ if (NOT EXISTS ${core_lib_PATH})
7777endif ()
7878
7979add_library (lib_realm_core STATIC IMPORTED )
80- set_target_properties (lib_realm_core PROPERTIES IMPORTED_LOCATION ${core_lib_PATH} )
80+
81+ # -latomic is not set by default for mips and armv5.
82+ # See https://code.google.com/p/android/issues/detail?id=182094
83+ set_target_properties (lib_realm_core PROPERTIES IMPORTED_LOCATION ${core_lib_PATH}
84+ IMPORTED_LINK_INTERFACE_LIBRARIES atomic )
8185
8286# Sync static library
8387set (sync_lib_PATH ${REALM_CORE_DIST_DIR} /librealm-sync-android -${ANDROID_ABI} .a)
@@ -94,7 +98,8 @@ if (NOT EXISTS ${sync_lib_PATH})
9498 endif ()
9599endif ()
96100add_library (lib_realm_sync STATIC IMPORTED )
97- set_target_properties (lib_realm_sync PROPERTIES IMPORTED_LOCATION ${sync_lib_PATH} )
101+ set_target_properties (lib_realm_sync PROPERTIES IMPORTED_LOCATION ${sync_lib_PATH}
102+ IMPORTED_LINK_INTERFACE_LIBRARIES lib_realm_core )
98103
99104# build application's shared lib
100105include_directories (${REALM_CORE_DIST_DIR} /include
@@ -172,12 +177,11 @@ endif()
172177
173178add_library (realm-jni SHARED ${jni_SRC} ${objectstore_SRC} ${objectstore_sync_SRC} )
174179add_dependencies (realm-jni jni_headers )
175- # -latomic is not set by default for mips. See https://code.google.com/p/android/issues/detail?id=182094
180+
176181if (build_SYNC)
177- # FIXME: The order matters! lib_realm_sync needs to be in front of lib_realm_core!! Find out why!!
178- target_link_libraries (realm-jni log android atomic lib_realm_sync lib_realm_core )
182+ target_link_libraries (realm-jni log android lib_realm_sync )
179183else ()
180- target_link_libraries (realm-jni log android atomic lib_realm_core )
184+ target_link_libraries (realm-jni log android lib_realm_core )
181185endif ()
182186
183187# Strip the release so files and backup the unstripped versions
0 commit comments