build.zig: add support for using "zig c++" as the bootstrap c++ compiler

The build was previously failing with `error: unknown command: -print-file-name=libstdc++.a`
because the command invocation was
`zig -print-file-name=libstdc++.a`
instead of
`zig c++ -print-file-name=libstdc++.a`

note: .cxx_compiler_arg1 = "" instead of undefined to avoid breaking existing setups without requiring to run cmake again.
This commit is contained in:
Xavier Bouchoux
2023-10-16 22:49:27 +02:00
parent 0afead5651
commit 69d6f2e1b8
2 changed files with 14 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
#define ZIG_CMAKE_STATIC_LIBRARY_PREFIX "@CMAKE_STATIC_LIBRARY_PREFIX@"
#define ZIG_CMAKE_STATIC_LIBRARY_SUFFIX "@CMAKE_STATIC_LIBRARY_SUFFIX@"
#define ZIG_CXX_COMPILER "@CMAKE_CXX_COMPILER@"
#define ZIG_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@"
#define ZIG_DIA_GUIDS_LIB "@ZIG_DIA_GUIDS_LIB_ESCAPED@"
#define ZIG_LLD_INCLUDE_PATH "@LLD_INCLUDE_DIRS@"
#define ZIG_LLD_LIBRARIES "@LLD_LIBRARIES@"