Add and test libc++experimental.

Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Test: ./run_tests.py --bitness 64 --host
Bug: None
Change-Id: I9f712f8f73a8335aadf82af6686158de819442be
This commit is contained in:
Dan Albert
2018-12-06 13:57:32 -08:00
parent 91714f98f6
commit fc8f268b2c
2 changed files with 50 additions and 29 deletions

View File

@@ -14,10 +14,47 @@
// limitations under the License.
//
cc_defaults {
name: "libc++ defaults",
host_supported: true,
local_include_dirs: ["include"],
export_include_dirs: ["include"],
cflags: ["-Wall", "-Werror", "-Wno-unused-parameter"],
cppflags: [
"-std=c++14",
"-nostdinc++",
"-fexceptions",
"-DLIBCXX_BUILDING_LIBCXXABI",
"-D_LIBCPP_BUILDING_LIBRARY",
],
rtti: true,
stl: "none",
target: {
linux_bionic: {
enabled: true,
},
windows: {
enabled: true,
cflags: [
"-D_LIBCPP_HAS_THREAD_API_WIN32",
"-D_LIBCXXABI_BUILDING_LIBRARY",
"-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
"-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
"-UWIN32_LEAN_AND_MEAN",
],
},
windows_x86: {
cflags: [
"-fsjlj-exceptions",
],
},
},
}
// host + device static lib
cc_library_static {
name: "libc++_static",
host_supported: true,
defaults: ["libc++ defaults"],
vendor_available: true,
recovery_available: true,
srcs: [
@@ -52,43 +89,15 @@ cc_library_static {
"src/variant.cpp",
"src/vector.cpp",
],
local_include_dirs: ["include"],
export_include_dirs: ["include"],
cflags: ["-Wall", "-Werror", "-Wno-unused-parameter"],
cppflags: [
"-std=c++14",
"-nostdinc++",
"-fexceptions",
"-DLIBCXX_BUILDING_LIBCXXABI",
"-D_LIBCPP_BUILDING_LIBRARY",
],
rtti: true,
whole_static_libs: [
"libc++abi",
],
stl: "none",
target: {
linux_bionic: {
enabled: true,
},
windows: {
enabled: true,
cflags: [
"-D_LIBCPP_HAS_THREAD_API_WIN32",
"-D_LIBCXXABI_BUILDING_LIBRARY",
"-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
"-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
"-UWIN32_LEAN_AND_MEAN",
],
srcs: [
"src/support/win32/*.cpp",
]
},
windows_x86: {
cflags: [
"-fsjlj-exceptions",
],
},
},
}
@@ -129,6 +138,14 @@ cc_library_shared {
},
}
cc_library_static {
name: "libc++experimental",
defaults: ["libc++ defaults"],
srcs: [
"src/experimental/memory_resource.cpp",
],
}
// This target is used to extract the build commands for a test executable.
// See run_tests.py.
cc_binary {
@@ -151,6 +168,9 @@ cc_binary {
// http://llvm.org/bugs/show_bug.cgi?id=21421
"-O0",
],
static_libs: [
"libc++experimental",
],
rtti: true,
local_include_dirs: [
"test/support",

View File

@@ -51,6 +51,7 @@ class Configuration(libcxx.test.config.Configuration):
def configure_features(self):
self.config.available_features.add('long_tests')
self.config.available_features.add('c++experimental')
std_pattern = re.compile(r'-std=(c\+\+\d[0-9x-z])')
match = std_pattern.search(self.cxx.cxx_template)
if match: