[test-suite] r354835 - [CMake] Support alternative C++ ABI library
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 25 16:40:53 PST 2019
Author: phosek
Date: Mon Feb 25 16:40:53 2019
New Revision: 354835
URL: http://llvm.org/viewvc/llvm-project?rev=354835&view=rev
Log:
[CMake] Support alternative C++ ABI library
Do not assume that every platform has libsupc++.
Differential Revision: https://reviews.llvm.org/D58598
Modified:
test-suite/trunk/CMakeLists.txt
test-suite/trunk/MultiSource/Applications/obsequi/CMakeLists.txt
Modified: test-suite/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/CMakeLists.txt?rev=354835&r1=354834&r2=354835&view=diff
==============================================================================
--- test-suite/trunk/CMakeLists.txt (original)
+++ test-suite/trunk/CMakeLists.txt Mon Feb 25 16:40:53 2019
@@ -155,6 +155,21 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} ${TEST_SUITE_EXTRA_EXE_LINKER_FLAGS}")
+# This is either directly the C++ ABI library or the full C++ library
+# which pulls in the ABI transitively.
+set(TEST_SUITE_CXX_ABI "default" CACHE STRING "Specify C++ ABI library to use.")
+set(CXXABIS "none default libstdc++ libsupc++ libc++ libc++abi")
+set_property(CACHE TEST_SUITE_CXX_ABI PROPERTY STRINGS "${CXXABIS}")
+if (TEST_SUITE_CXX_ABI STREQUAL "default")
+ if (APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD|Fuchsia")
+ set(TEST_SUITE_CXX_ABI_LIBNAME "c++abi")
+ else()
+ set(TEST_SUITE_CXX_ABI_LIBNAME "supc++")
+ endif()
+else()
+ STRING(REGEX REPLACE "^lib" "" TEST_SUITE_CXX_ABI_LIBNAME ${TEST_SUITE_CXX_ABI})
+endif()
+
include(TestSuite)
include(SingleMultiSource)
find_package(TCL)
Modified: test-suite/trunk/MultiSource/Applications/obsequi/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/obsequi/CMakeLists.txt?rev=354835&r1=354834&r2=354835&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Applications/obsequi/CMakeLists.txt (original)
+++ test-suite/trunk/MultiSource/Applications/obsequi/CMakeLists.txt Mon Feb 25 16:40:53 2019
@@ -6,7 +6,7 @@ else()
list(APPEND CPPFLAGS -DHASHCODEBITS=23)
endif()
if(NOT "${ARCH}" STREQUAL "PowerPC")
- list(APPEND LDFLAGS -lsupc++)
+ list(APPEND LDFLAGS -l${TEST_SUITE_CXX_ABI_LIBNAME})
endif()
set(RUN_OPTIONS < input)
llvm_multisource(Obsequi)
More information about the llvm-commits
mailing list