Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building Robolectric's nativeruntime with gcc/g++ #6900

Merged
merged 1 commit into from Dec 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 2 additions & 7 deletions nativeruntime/cpp/CMakeLists.txt
Expand Up @@ -3,11 +3,6 @@ cmake_minimum_required(VERSION 3.10)
# This is needed to ensure that static libraries can be linked into shared libraries.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# Building the nativeruntime does not work with GCC due to libstddc++ linker errors.
# TODO: figure out which linker args are needed to build with GCC.
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")

# Some libutils headers require C++17
set (CMAKE_CXX_STANDARD 17)

Expand Down Expand Up @@ -100,6 +95,8 @@ target_link_libraries(androidsqlite
${STATIC_ICUI18N_LIBRARY}
${STATIC_ICUUC_LIBRARY}
${STATIC_ICUDATA_LIBRARY}
-ldl
-lpthread
)

include_directories(${JNI_INCLUDE_DIRS})
Expand Down Expand Up @@ -142,8 +139,6 @@ if (CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(nativeruntime
-static-libgcc
-static-libstdc++
-ldl
-lpthread
-Wl,--no-undefined # print an error if there are any undefined symbols
)
endif()