funky-yellow-wombat 99d879ad32 Support GLIBC Version Targeting
Support GLIBC version targeting, example:

`cmake -B build -G Ninja --toolchain cmake/x86_64-linux-gnu.2.17.cmake`
(You would need to create this file)

Because `NAME_WL` was used all extension info was lost, with `NAME_WLE` along with the regex change on the ABI match group we're able to recover and use the full ABI target string from the filename.

https://github.com/ziglang/zig/tree/master/lib/libc/glibc#zig-gnu-c-library-glibc-support
2025-02-17 15:07:32 +00:00
2025-02-17 15:07:32 +00:00
2022-10-21 02:36:21 +02:00
2022-10-21 02:36:21 +02:00
2022-10-21 02:36:21 +02:00
2024-12-20 16:03:00 +01:00
2025-01-12 14:41:31 +01:00
2025-01-15 02:37:44 +01:00
2025-01-15 02:37:44 +01:00
2024-12-20 16:03:00 +01:00

zig-cross

Example of using zig as a CMake Toolchain for cross compiling.

Reference: https://zig.news/kristoff/cross-compile-a-c-c-project-with-zig-3599

Building

  • Install zig in your PATH (choco install zig on Windows)
  • cmake -B build-aarch64 -G Ninja --toolchain aarch64-linux-gnu.cmake
  • cmake --build build-arch64

You can create toolchains for other triples as well, just create a file named aarch64-windows-gnu.cmake with the following contents to build for Windows on ARM64:

include(${CMAKE_CURRENT_LIST_DIR}/cmake/zig-toolchain.cmake)

clangd

To get clangd to work you need to first enable generation of compile_commands.json:

cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

Additionally you need to pass pass the following arguments to clangd:

"clangd.arguments": [
    "--log=verbose",
    "--query-driver=**/zig-cc.cmd,**/zig-cc,**/zig-c++.cmd,**/zig-c++",
]

Without these arguments clangd will not query the driver (zig c++) and the include paths will not be resolved correctly.

Description
Languages
CMake 89.1%
C 3.4%
C++ 3.1%
Shell 2.3%
Batchfile 2.1%