build stage3: detect system libcxx

Detect system libcxx name with the CMake build system and convey that
information to build.zig via config.h so that the same system libcxx is
used for stage3.

This undoes the hacky search 901457d173 .

closes #17018
This commit is contained in:
Michael Dusan
2023-09-01 10:04:26 -04:00
committed by Jakub Konka
parent 1816bb4ab0
commit 3cf71580c4
3 changed files with 22 additions and 10 deletions

View File

@@ -124,6 +124,13 @@ endif()
set(ZIG_PIE off CACHE BOOL "produce a position independent zig executable")
# Detect system libcxx name.
if ("c++" IN_LIST CMAKE_CXX_IMPLICIT_LINK_LIBRARIES)
set(ZIG_SYSTEM_LIBCXX "c++" CACHE STRING "system libcxx name for build.zig")
else()
set(ZIG_SYSTEM_LIBCXX "stdc++" CACHE STRING "system libcxx name for build.zig")
endif()
find_package(llvm 16)
find_package(clang 16)
find_package(lld 16)