build: early check user on libclang.so due to bindgen

This commit is contained in:
Matteo Settenvini 2025-02-22 00:35:01 +01:00
parent be565d948b
commit a521428ea2
5 changed files with 16 additions and 5 deletions

View File

@ -34,7 +34,7 @@ repos:
hooks:
- id: commitizen
- id: commitizen-branch
stages: [push]
stages: [pre-push]
- repo: local
hooks:

View File

@ -33,6 +33,15 @@ setup_crates(${CMAKE_CURRENT_SOURCE_DIR})
# -------------------------------
# Install Rust libraries or binaries
# libclang is required for bindgen, just check here
# for an early failure
unset(libclang_names)
foreach(clang_ver RANGE 9 100)
list(PREPEND libclang_names "clang-${clang_ver}")
endforeach()
list(REVERSE libclang_names)
find_library(LIBCLANG NAMES clang ${libclang_names} REQUIRED)
set(libname "libnss_parental_ctrls.so")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnss_parental_ctrls.so
TYPE LIB

View File

@ -9,6 +9,10 @@ version = "0.1.0"
edition = "2024"
license = "EUPL-1.2"
readme = "README.md"
rust-version = "1.85"
[profile.release]
panic = "unwind" # We rely on this for the NSS module
[workspace]
members = ["crates/nss"]

View File

@ -11,15 +11,13 @@ version = { workspace = true }
authors = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
[lib]
name = "nss_parental_ctrls"
path = "src/lib.rs"
crate-type = ["cdylib"]
[profile.release]
panic = "unwind" # We rely on this
[build-dependencies]
bindgen = { workspace = true }

View File

@ -2,6 +2,6 @@
# SPDX-License-Identifier: CC0-1.0
[toolchain]
channel = "1.85"
channel = "stable"
profile = "default"
components = ["rustfmt"]