File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed
Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ re-pcre2 = []
4848re-onig = [" onig" ]
4949re-stdcpp = []
5050re-re2 = []
51+ libcxx = []
5152re-dphobos = []
5253re-dphobos-dmd = [" re-dphobos" ]
5354re-dphobos-dmd-ct = [" re-dphobos-dmd" ]
Original file line number Diff line number Diff line change @@ -20,10 +20,20 @@ fn main() {
2020 }
2121 if env:: var ( "CARGO_FEATURE_RE_STDCPP" ) . is_ok ( ) {
2222 // stdcpp is a C++ library, so we need to compile our shim layer.
23- cc:: Build :: new ( )
24- . cpp ( true )
25- . file ( "src/ffi/stdcpp.cpp" )
26- . compile ( "libcstdcpp.a" ) ;
23+ if !env:: var ( "CARGO_FEATURE_LIBCXX" ) . is_ok ( ) {
24+ // use default stdlib
25+ cc:: Build :: new ( )
26+ . cpp ( true )
27+ . file ( "src/ffi/stdcpp.cpp" )
28+ . compile ( "libcstdcpp.a" ) ;
29+ } else {
30+ // use libc++ stdlib
31+ cc:: Build :: new ( )
32+ . cpp ( true )
33+ . file ( "src/ffi/stdcpp.cpp" )
34+ . cpp_link_stdlib ( "c++" )
35+ . compile ( "libcstdcpp.a" ) ;
36+ }
2737 }
2838 if env:: var ( "CARGO_FEATURE_RE_RE2" ) . is_ok ( ) {
2939 // RE2 is a C++ library, so we need to compile our shim layer.
Original file line number Diff line number Diff line change 11#! /bin/bash
22
33usage () {
4- echo " Usage: $( basename $0 ) [dphobos-dmd | dphobos-ldc | dphobos-dmd-ct | dphobos-ldc-ct | rust | rust-bytes | pcre1 | pcre2 | stdcpp | re2 | onig | tcl ]" >&2
4+ echo " Usage: $( basename $0 ) [dphobos-dmd | dphobos-ldc | dphobos-dmd-ct | dphobos-ldc-ct | rust | rust-bytes | pcre1 | pcre2 | stdcpp | stdcpp-libcxx | re2 | onig | tcl ]" >&2
55 exit 1
66}
77
@@ -33,6 +33,9 @@ case $which in
3333 stdcpp)
3434 exec cargo bench --bench bench --features re-stdcpp " $@ "
3535 ;;
36+ stdcpp-libcxx)
37+ exec cargo bench --bench bench --features ' re-stdcpp libcxx' " $@ "
38+ ;;
3639 re2)
3740 exec cargo bench --bench bench --features re-re2 " $@ "
3841 ;;
You can’t perform that action at this time.
0 commit comments