check both for the full and the short name of the C++ ABI library, unset cache if the library is not usable
@@ -209,8 +209,8 @@ set_source_files_properties(
function(test_cxx CXX_RUNTIME_NAME IS_STDLIB)
- set(CXX_RUNTIME_NAME "${CMAKE_SHARED_LIBRARY_PREFIX}${CXX_RUNTIME_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
- find_library(CXX_RUNTIME_LIB NAMES ${CXX_RUNTIME_NAME})
+ set(CXX_RUNTIME_NAME_FULL "${CMAKE_SHARED_LIBRARY_PREFIX}${CXX_RUNTIME_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ find_library(CXX_RUNTIME_LIB NAMES ${CXX_RUNTIME_NAME_FULL} ${CXX_RUNTIME_NAME})
if (CXX_RUNTIME_LIB)
message(STATUS "Testing ${CXX_RUNTIME_LIB} as the C++ runtime library")
if (ANDROID)
@@ -224,6 +224,8 @@ function(test_cxx CXX_RUNTIME_NAME IS_STDLIB)
CMAKE_FLAGS "-DCXX_RUNTIME=${CXX_RUNTIME_LIB}" ${CXX_RUNTIME_FLAGS})
if (USERUNTIME)
set(CXX_RUNTIME ${CXX_RUNTIME_LIB} PARENT_SCOPE)
+ else ()
+ unset(CXX_RUNTIME_LIB CACHE)
endif()
endif()
endfunction()
