Make a libc++ gtest build

This commit is contained in:
Jeremy Rifkin 2024-08-18 13:13:25 -05:00
parent f11a967444
commit ff7da41124
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
2 changed files with 9 additions and 1 deletions

View File

@ -32,5 +32,8 @@ git fetch --depth 1 origin f8d7d77c06936315286eb55f8de22cd23c188571
git checkout FETCH_HEAD
mkdir build
cd build
cmake .. -GNinja
cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=/tmp/gtest_install
sudo ninja install
rm -rf *
cmake .. -GNinja -DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_INSTALL_PREFIX=/tmp/gtest_install_libcxx
sudo ninja install

View File

@ -17,6 +17,10 @@ def get_c_compiler_counterpart(compiler: str) -> str:
def build(runner: MatrixRunner):
if platform.system() == "Linux":
matrix = runner.current_config()
if "stdlib" in matrix and matrix["stdlib"] == "libc++":
gtest_path = "/tmp/gtest_install_libcxx"
else:
gtest_path = "/tmp/gtest_install"
args = [
"cmake",
"..",
@ -35,6 +39,7 @@ def build(runner: MatrixRunner):
f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On",
f"-DCPPTRACE_USE_EXTERNAL_ZSTD=On",
f"-DCPPTRACE_USE_EXTERNAL_GTEST=On",
f"-DCMAKE_PREFIX_PATH={gtest_path}",
*(["-DCMAKE_CXX_FLAGS=-stdlib=libc++"] if "stdlib" in matrix and matrix["stdlib"] == "libc++" else [])
]
return runner.run_command(*args) and runner.run_command("ninja")