Fix C++ runtime detection.

- Don't try to detect libc++abi.  It doesn't actually work, so don't
   try it.
 - Correctly try to link the standard library.

This should fix the build on GNU/Linux systems with libc++abi.so
installed (including our Ubuntu CI!).
main
David Chisnall 5 years ago committed by David Chisnall
parent 4cf4ad145c
commit a575db7392

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1)
project(test_cxx_runtime)
add_executable(test_cxx_runtime typeinfo_test.cc)
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
add_executable(test_cxx_stdlib typeinfo_test.cc)
if (CXX_RUNTIME)
target_link_libraries(test_cxx_runtime ${CXX_RUNTIME})
set_target_properties(test_cxx_runtime PROPERTIES

@ -284,8 +284,9 @@ if (ENABLE_OBJCXX)
if (NOT CXX_RUNTIME)
test_cxx(supc++ false)
endif (NOT CXX_RUNTIME)
# libc++abi does not currently work, don't try it.
if (NOT CXX_RUNTIME)
test_cxx(c++abi false)
# test_cxx(c++abi false)
endif (NOT CXX_RUNTIME)
# If we have a C++ ABI library, then we can produce a single libobjc that
@ -295,10 +296,11 @@ if (ENABLE_OBJCXX)
message(STATUS "Using ${CXX_RUNTIME} as the C++ runtime library")
else()
message(STATUS "Testing C++ standard library")
message(STATUS "Using ${CMAKE_C_COMPILER}")
try_compile(USERUNTIME
"${CMAKE_BINARY_DIR}/CMake"
"${CMAKE_CURRENT_LIST_DIR}/CMake"
test_cxx_runtime)
test_cxx_stdlib)
if (${USERUNTIME})
message(STATUS "libobjc will depend on C++ standard library")
set(CXXRT_IS_STDLIB true)

Loading…
Cancel
Save