ceph/librarytest.sh
Adam C. Emerson ba5ce157bd build: Use the right experimental library
Test whether we're building with libstdc++ or libc++.

Use stdc++filesystem if the former and c++experimental if the later.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2018-02-09 19:54:02 -05:00

18 lines
324 B
Bash
Executable File

#!/bin/sh
CXX=$1
shift
echo "#include <utility>
#if defined(_LIBCPP_VERSION)
#define MYRESULT libc++
#elif defined(__GLIBCXX__)
#define MYRESULT libstdc++
#else
#define MYRESULT unknown
#endif
HelloFriendsTheAnsWerIs MYRESULT" | ${CXX} -E -xc++ $* - | \
grep "HelloFriendsTheAnsWerIs" | cut -f 2 -d ' ' | tr -d '\n'